Index: /issm/trunk/src/c/DataSet/Inputs.cpp
===================================================================
--- /issm/trunk/src/c/DataSet/Inputs.cpp	(revision 3856)
+++ /issm/trunk/src/c/DataSet/Inputs.cpp	(revision 3857)
@@ -486,5 +486,5 @@
 /*}}}*/
 /*FUNCTION Inputs::ChangeEnum{{{1*/
-void  Inputs::ChangeEnum(int enumtype,int newenumtype){
+void  Inputs::ChangeEnum(int oldenumtype,int newenumtype){
 
 	/*Go through dataset of inputs and look for input with 
@@ -493,9 +493,20 @@
 	Input* input=NULL;
 
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		input=(Input*)(*object); 
-
-		if (input->EnumType()==enumtype){
+	/*Delete existing input of newenumtype if it exists*/
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		input=(Input*)(*object); 
+
+		if (input->EnumType()==newenumtype){
+			this->DeleteObject(input);
+			break;
+		}
+	}
+
+	/*Change enum_type of input of oldenumtype*/
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		input=(Input*)(*object); 
+
+		if (input->EnumType()==oldenumtype){
 			input->ChangeEnum(newenumtype);
 			break;
