Index: /issm/trunk/src/c/objects/Hook.cpp
===================================================================
--- /issm/trunk/src/c/objects/Hook.cpp	(revision 3398)
+++ /issm/trunk/src/c/objects/Hook.cpp	(revision 3399)
@@ -311,4 +311,5 @@
 	/*go pickup the correct objects, ids and offsets :*/
 	subnum=numindices;
+	if(subnum<1) ISSMERROR("Trying to spawn an empty ElementProperties!");
 
 	subobjects=(Object**)xmalloc(subnum*sizeof(Object*));
@@ -316,12 +317,9 @@
 	suboffsets=(int*)xmalloc(subnum*sizeof(int));
 
-	if(subnum){
-		for(i=0;i<subnum;i++){
-			subobjects[i]=this->objects[indices[i]];
-			subids[i]=this->ids[indices[i]];
-			suboffsets[i]=this->offsets[indices[i]];
-		}
-	}
-	else ISSMERROR("Trying to spawn an empty ElementProperties!");
+	for(i=0;i<subnum;i++){
+		subobjects[i]=this->objects[indices[i]];
+		subids[i]=this->ids[indices[i]];
+		suboffsets[i]=this->offsets[indices[i]];
+	}
 
 	return new Hook(subobjects,subids,suboffsets,subnum);
Index: /issm/trunk/src/c/objects/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Tria.cpp	(revision 3398)
+++ /issm/trunk/src/c/objects/Tria.cpp	(revision 3399)
@@ -233,5 +233,5 @@
 	//if (id==1) printf("WARNING if QMU: no hydrostatic equilibrium is applied here (conflict with prognostic, which does not have matpar)\n");
 	//For now
-	inputs->Recover("thickness",&this->properties.h[0],1,dofs,3,(void**)nodes);
+	if(this->properties.h) inputs->Recover("thickness",&this->properties.h[0],1,dofs,3,(void**)nodes);
 	//Later
 	/*
@@ -249,10 +249,10 @@
 	}
 	*/
-	inputs->Recover("surface",&this->properties.s[0],1,dofs,3,(void**)nodes);
-	inputs->Recover("bed",&this->properties.b[0],1,dofs,3,(void**)nodes);
-	inputs->Recover("drag",&this->properties.k[0],1,dofs,3,(void**)nodes);
-	inputs->Recover("melting",&this->properties.melting[0],1,dofs,3,(void**)nodes);
-	inputs->Recover("accumulation",&this->properties.accumulation[0],1,dofs,3,(void**)nodes);
-	inputs->Recover("geothermalflux",&this->properties.geothermalflux[0],1,dofs,3,(void**)nodes);
+	if (this->properties.s)              inputs->Recover("surface",&this->properties.s[0],1,dofs,3,(void**)nodes);
+	if (this->properties.b)              inputs->Recover("bed",&this->properties.b[0],1,dofs,3,(void**)nodes);
+	if (this->properties.k)              inputs->Recover("drag",&this->properties.k[0],1,dofs,3,(void**)nodes);
+	if (this->properties.melting)        inputs->Recover("melting",&this->properties.melting[0],1,dofs,3,(void**)nodes);
+	if (this->properties.accumulation)   inputs->Recover("accumulation",&this->properties.accumulation[0],1,dofs,3,(void**)nodes);
+	if (this->properties.geothermalflux) inputs->Recover("geothermalflux",&this->properties.geothermalflux[0],1,dofs,3,(void**)nodes);
 	
 	//Update material if necessary
