Index: /issm/trunk-jpl/src/m/classes/friction.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/friction.m	(revision 25399)
+++ /issm/trunk-jpl/src/m/classes/friction.m	(revision 25400)
@@ -82,5 +82,10 @@
 
 			WriteData(fid,prefix,'name','md.friction.law','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			if(size(self.coefficient,1)==md.mesh.numberofelements | size(self.coefficient,1)==md.mesh.numberofelements+1),
+				mattype=2; tsl = md.mesh.numberofelements;
+			else
+				mattype=1; tsl = md.mesh.numberofvertices;
+			end
+			WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'fieldname','p','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2);
Index: /issm/trunk-jpl/src/m/classes/inversionvalidation.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/inversionvalidation.m	(revision 25399)
+++ /issm/trunk-jpl/src/m/classes/inversionvalidation.m	(revision 25400)
@@ -70,6 +70,6 @@
 			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',supportedcostfunctions());
 			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
-			md = checkfield(md,'fieldname','inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
-			md = checkfield(md,'fieldname','inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]);
+			md = checkfield(md,'fieldname','inversion.min_parameters','size',[NaN num_controls]);
+			md = checkfield(md,'fieldname','inversion.max_parameters','size',[NaN num_controls]);
 
 			if strcmp(solution,'BalancethicknessSolution')
Index: /issm/trunk-jpl/src/m/classes/matice.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/matice.m	(revision 25399)
+++ /issm/trunk-jpl/src/m/classes/matice.m	(revision 25400)
@@ -175,5 +175,10 @@
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			if(size(self.rheology_B,1)==md.mesh.numberofelements | size(self.rheology_B,1)==md.mesh.numberofelements+1),
+				mattype=2; tsl = md.mesh.numberofelements;
+			else
+				mattype=1; tsl = md.mesh.numberofvertices;
+			end
+			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+mattype,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
