Index: /issm/trunk/src/c/io/FetchData.cpp
===================================================================
--- /issm/trunk/src/c/io/FetchData.cpp	(revision 7187)
+++ /issm/trunk/src/c/io/FetchData.cpp	(revision 7188)
@@ -95,9 +95,5 @@
 	int dummy=0;
 
-	if(mxIsEmpty(dataref) ){
-		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
-		outmatrix=NULL;
-	}
-	else if (mxIsDouble(dataref) ){
+	if (mxIsDouble(dataref) ){
 
 		/*Check dataref is not pointing to NaN: */
Index: /issm/trunk/src/c/modules/Solverx/Solverx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Solverx/Solverx.cpp	(revision 7187)
+++ /issm/trunk/src/c/modules/Solverx/Solverx.cpp	(revision 7188)
@@ -40,4 +40,5 @@
 
 	/*First, check that f-set is not NULL, ie model is fully constrained: */
+	_assert_(Kff);
 	MatGetSize(Kff,&global_m,&global_n); _assert_(global_m==global_m);
 	if(!global_n){
Index: /issm/trunk/src/c/toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp	(revision 7187)
+++ /issm/trunk/src/c/toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp	(revision 7188)
@@ -54,5 +54,10 @@
 		cols=mxGetN(mxmatrix);
 		nnz=mxGetNzmax(mxmatrix);
-		nz=(int)((double)nnz/(double)rows);
+		if(rows){
+			nz=(int)((double)nnz/(double)rows);
+		}
+		else{
+			nz=0;
+		}
 
 		ierr=MatCreateSeqAIJ(PETSC_COMM_SELF,rows,cols,nz,PETSC_NULL,&matrix);CHKERRQ(ierr);
