Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 9385)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 9386)
@@ -31,6 +31,4 @@
 	double *pressureload   = NULL;
 	double *elements_type  = NULL;
-	double *thickness      = NULL;
-	double *bed            = NULL;
 	double *nodeoniceshelf = NULL;
 	double *riftinfo       = NULL;
@@ -65,8 +63,7 @@
 	/*Create pressure loads as boundary conditions. Pay attention to the partitioning if we are running in parallel (the nodes
 	 * referenced by a certain load must belong to the cluster node): */
+	iomodel->FetchData(3,PressureloadEnum,ThicknessEnum,BedEnum);
 	iomodel->FetchData(&pressureload,&numberofpressureloads,NULL,PressureloadEnum);
 	iomodel->FetchData(&elements_type,NULL,NULL,ElementsTypeEnum);
-	iomodel->FetchData(&thickness,NULL,NULL,ThicknessEnum);
-	iomodel->FetchData(&bed,NULL,NULL,BedEnum);
 
 	/*Initialize counter: */
@@ -125,8 +122,7 @@
 
 	/*Free data: */
+	iomodel->DeleteData(3,PressureloadEnum,ThicknessEnum,BedEnum);
+	xfree((void**)&elements_type);
 	xfree((void**)&pressureload);
-	xfree((void**)&elements_type);
-	xfree((void**)&thickness);
-	xfree((void**)&bed);
 
 	/*create penalties for nodes on the base of icesheet. We must have wb=ub*db/dx+vb*db/dy */
Index: /issm/trunk/src/c/objects/IoModel.cpp
===================================================================
--- /issm/trunk/src/c/objects/IoModel.cpp	(revision 9385)
+++ /issm/trunk/src/c/objects/IoModel.cpp	(revision 9386)
@@ -71,5 +71,13 @@
 	delete this->constants;
 
-	for(int i=0;i<MaximumNumberOfEnums;i++) xfree((void**)&this->data[i]);
+	/*Some checks in debugging mode*/
+#ifdef _ISSM_DEBUG_
+	for(int i=0;i<MaximumNumberOfEnums;i++){
+		if(this->data[i]){
+			_printf_("Info: previous pointer of %s has not been freed (DeleteData has not been called)",EnumToStringx(i));
+		}
+	}
+#endif
+
 	xfree((void**)&this->data);
 
@@ -489,6 +497,14 @@
 		
 		dataenum=va_arg(ap, int);
+
+		/*Some checks in debugging mode*/
+		/*{{{*/
+		#ifdef _ISSM_DEBUG_
 		_assert_(dataenum<MaximumNumberOfEnums);
-		_assert_(!this->data[dataenum]);
+		if(this->data[dataenum]){
+			_error_("Info: trying to fetch %s but previous pointer has not been freed (DeleteData has not been called)",EnumToStringx(dataenum));
+		}
+		#endif
+		/*}}}*/
 
 		this->FetchData(&matrix,&M,&N,dataenum);
Index: /issm/trunk/src/c/objects/Loads/Icefront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 9385)
+++ /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 9386)
@@ -64,4 +64,5 @@
 		segment_width=6;
 	}
+	_assert_(iomodel->f(PressureloadEnum));
 	element=(int)(*(iomodel->f(PressureloadEnum)+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill)
 
