Index: ../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
===================================================================
--- ../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	(revision 18652)
+++ ../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	(revision 18653)
@@ -30,8 +30,11 @@
 	femmodel->parameters->FindParam(&analysisenum,AnalysisTypeEnum);
 	Analysis* analysis = EnumToAnalysis(analysisenum);
 
+	/*Check if there are penalties*/
+	bool ispenalty = femmodel->loads->IsPenalty(configuration_type);
+
 	/*First, we might need to do a dry run to get kmax if penalties are employed*/
-	if(femmodel->loads->IsPenalty(configuration_type)){
+	if(ispenalty){
 
 		/*Allocate Kff_temp*/
 		Matrix<IssmDouble> *Kff_temp = NULL;
@@ -92,7 +95,7 @@
 	}
 
 	/*Now deal with penalties (only in loads)*/
-	if(femmodel->loads->IsPenalty(configuration_type)){
+	if(ispenalty){
 		for (i=0;i<femmodel->loads->Size();i++){
 			load=xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(i));
 			if(load->InAnalysis(configuration_type)){
