Index: /issm/trunk/src/m/solutions/SetCurrentAnalysisAlias.m
===================================================================
--- /issm/trunk/src/m/solutions/SetCurrentAnalysisAlias.m	(revision 4343)
+++ /issm/trunk/src/m/solutions/SetCurrentAnalysisAlias.m	(revision 4344)
@@ -10,28 +10,26 @@
 %
 
-
 	%first, look for analysis: 
-	int found=0;
+	found=-1;
 	for i=1:length(femmodel.analysis_type_list),
-		if analysis_type_list(i)==base_analysis_enum,
+		if femmodel.analysis_type_list(i)==base_analysis_enum,
 			found=i;
 			break;
+		end
 	end
 
-	if (found!=1),
+	if found==-1,
 		error('SetCurrentAnalysisAlias error message: could not find analysis_type in list of FemModel analyses');
 	end
-
 	
 	%activate matrices and vectors: 
-	femmodel.Rmg=femmodel.m_Rmg(found);
-	femmodel.Gmn=femmodel.m_Gmn(found);
-	femmodel.nodesets=femmodel.m_nodesets(found);
-	femmodel.yg=femmodel.m_yg(found);
-	femmodel.ys=femmodel.m_ys(found);
-
+	femmodel.Rmg=femmodel.m_Rmg{found};
+	femmodel.Gmn=femmodel.m_Gmn{found};
+	femmodel.nodesets=femmodel.m_nodesets{found};
+	femmodel.yg=femmodel.m_yg{found};
+	femmodel.ys=femmodel.m_ys{found};
 
 	%Now, plug analysis_counter and analysis_type inside the parameters: 
 	%set counter and analyse_type
-	femmodel.parameters.AnalysisCounter=found;
+	femmodel.parameters.AnalysisCounter=found-1; %for c indices
 	femmodel.parameters.AnalysisType=real_analysis_type;
Index: /issm/trunk/src/m/solutions/diagnostic_core.m
===================================================================
--- /issm/trunk/src/m/solutions/diagnostic_core.m	(revision 4343)
+++ /issm/trunk/src/m/solutions/diagnostic_core.m	(revision 4344)
@@ -29,6 +29,6 @@
 
 	%Compute slopes: 
-	if(ishutter)femmodel=surfaceslope_core(femmodel);end
-	if(isstokes)femmodel=bedslope_core(femmodel);end
+	if(ishutter), femmodel=surfaceslope_core(femmodel); end
+	if(isstokes), femmodel=bedslope_core(femmodel); end
 
 	if ishutter,
Index: /issm/trunk/src/m/solutions/surfaceslope_core.m
===================================================================
--- /issm/trunk/src/m/solutions/surfaceslope_core.m	(revision 4343)
+++ /issm/trunk/src/m/solutions/surfaceslope_core.m	(revision 4344)
@@ -24,5 +24,5 @@
 		femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,femmodel.parameters,SurfaceSlopeXEnum);
 		femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,femmodel.parameters,SurfaceSlopeYEnum);
-	}
+	end
 	
 	if solution_type==SurfaceSlopeSolutionEnum,
