Index: /issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.cpp	(revision 12277)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Elements/Penta.cpp	(revision 12278)
@@ -1478,5 +1478,6 @@
 
 	/*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
-	if (enum_type==MaterialsRheologyBbarEnum || enum_type==MaterialsRheologyZbarEnum) input=this->matice->inputs->GetInput(enum_type);
+	if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(MaterialsRheologyBEnum);
+	else if (enum_type==MaterialsRheologyZbarEnum) input=this->matice->inputs->GetInput(MaterialsRheologyZEnum);
 	else input=this->inputs->GetInput(enum_type);
 	//if (!input) _error_("Input %s not found in penta->inputs",EnumToStringx(enum_type)); why error out? if the requested input does not exist, we should still 
@@ -5096,4 +5097,7 @@
 	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
 
+	/*delete Average Z*/
+	this->matice->inputs->DeleteInput(MaterialsRheologyZbarEnum);
+
 } /*}}}*/
 /*FUNCTION Penta::GradjBbarPattyn {{{1*/
@@ -5116,4 +5120,7 @@
 	/*delete Average B*/
 	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+
+	/*delete Average Z*/
+	this->matice->inputs->DeleteInput(MaterialsRheologyZbarEnum);
 } /*}}}*/
 /*FUNCTION Penta::GradjBbarStokes {{{1*/
@@ -5136,4 +5143,7 @@
 	/*delete Average B*/
 	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+
+	/*delete Average Z*/
+	this->matice->inputs->DeleteInput(MaterialsRheologyZbarEnum);
 } /*}}}*/
 /*FUNCTION Penta::InputControlUpdate{{{1*/
