Index: /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 14433)
+++ /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 14434)
@@ -251,4 +251,7 @@
 	IssmDouble* localvalues=NULL;
 
+	/*Check that Kff has been alocated in debugging mode*/
+	_assert_(Kff);
+
 	/*If Kfs is not provided, call the other function*/
 	if(!Kfs){
Index: /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 14433)
+++ /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 14434)
@@ -190,5 +190,5 @@
 	IssmDouble* localvalues=NULL;
 
-	if(this->fsize){
+	if(this->fsize && pf){
 		/*first, retrieve values that are in the f-set from the g-set values vector: */
 		localvalues=xNew<IssmDouble>(this->fsize);
