Index: /issm/trunk/src/c/modules/Gradjx/Gradjx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Gradjx/Gradjx.cpp	(revision 4366)
+++ /issm/trunk/src/c/modules/Gradjx/Gradjx.cpp	(revision 4367)
@@ -26,4 +26,7 @@
 	numberofvertices=vertices->NumberOfVertices();
 
+	/*Allocate gradient: */
+	gradient=NewVec(numberofvertices);
+
 	/*Compute gradients: */
 	for (i=0;i<elements->Size();i++){
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4366)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4367)
@@ -996,5 +996,5 @@
 	
 	/*Do nothing if we  don't find it: */
-	if(!input)return;
+	if(!input) return;
 
 	/*Constrain input using cm_min and cm_max: */
@@ -1045,4 +1045,5 @@
 	/*Make a copy of the original input: */
 	original=(Input*)this->inputs->GetInput(original_enum);
+	if(!original)ISSMERROR(" could not find old input with enum: %s",EnumAsString(original_enum));
 	copy=(Input*)original->copy();
 
@@ -1061,4 +1062,5 @@
 	/*Make a copy of the original input: */
 	input=(Input*)this->inputs->GetInput(enum_type);
+	if(!input)ISSMERROR(" could not find old input with enum: %s",EnumAsString(enum_type));
 
 	/*Scale: */
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 4366)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 4367)
@@ -1371,5 +1371,5 @@
 	
 	/*Do nothing if we  don't find it: */
-	if(!input)return;
+	if(!input) return;
 
 	/*Constrain input using cm_min and cm_max: */
@@ -1435,4 +1435,5 @@
 	/*Make a copy of the original input: */
 	original=(Input*)this->inputs->GetInput(original_enum);
+	if(!original)ISSMERROR(" could not find old input with enum: %s",EnumAsString(original_enum));
 	copy=(Input*)original->copy();
 
@@ -1451,4 +1452,5 @@
 	/*Make a copy of the original input: */
 	input=(Input*)this->inputs->GetInput(enum_type);
+	if(!input)ISSMERROR(" could not find old input with enum: %s",EnumAsString(enum_type));
 
 	/*Scale: */
