Index: /issm/trunk/src/c/objects/IoModel.cpp
===================================================================
--- /issm/trunk/src/c/objects/IoModel.cpp	(revision 9387)
+++ /issm/trunk/src/c/objects/IoModel.cpp	(revision 9388)
@@ -508,10 +508,6 @@
 		/*}}}*/
 
+		/*Add to this->data: */
 		this->FetchData(&matrix,&M,&N,dataenum);
-		if(M*N==0){
-			_error_("Cannot add %s to Iomodel->data because the matrix found is empty",EnumToStringx(dataenum));
-		}
-
-		/*Add to this->data: */
 		this->data[dataenum]=matrix;
 	}
Index: /issm/trunk/src/c/shared/Exceptions/Exceptions.cpp
===================================================================
--- /issm/trunk/src/c/shared/Exceptions/Exceptions.cpp	(revision 9387)
+++ /issm/trunk/src/c/shared/Exceptions/Exceptions.cpp	(revision 9388)
@@ -10,4 +10,7 @@
 #include "../shared.h"
 #include "../../include/include.h"
+#ifdef _SERIAL_
+#include "mex.h"
+#endif
 
 ErrorException::ErrorException(const string &what_arg){
@@ -45,6 +48,6 @@
 			printf("[%i] %s error message: %s\n\n",my_rank,function_name.c_str(),what());
 		#else
-			printf("\n??? Error using ==> %s at %i\n",file_name.c_str(),file_line);
-			printf("%s error message: %s\n\n",function_name.c_str(),what());
+			mexErrMsgTxt(exprintf("\n??? Error using ==> %s at %i\n%s error message: %s\n",
+							file_name.c_str(),file_line,function_name.c_str(),what()));
 		#endif
 	}
