Index: /issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 19260)
+++ /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 19261)
@@ -412,4 +412,8 @@
 		ConfigureObjectsx(output->elements,output->loads,output->nodes,output->vertices,output->materials,output->parameters);
 	}
+
+	/*Reset current configuration: */
+	analysis_type=output->analysis_type_list[analysis_counter];
+	output->SetCurrentConfiguration(analysis_type);
 
 	return output;
@@ -650,4 +654,5 @@
 
 	FILE* restartfid=NULL;
+	FILE* output_fid=NULL;
 	char* restartfilename = NULL;
 	int   femmodel_size=0; 
@@ -679,7 +684,11 @@
 	femmodel_buffer_ini=femmodel_buffer; //keep track of the initial position, so as to free later.
 
+	this->parameters->FindParam(&output_fid,OutputFilePointerEnum);
+
 	/*Create new FemModel by demarshalling the buffer: */
 	this->Marshall(&femmodel_buffer,NULL,MARSHALLING_BACKWARD);
 
+	this->parameters->SetParam(output_fid,OutputFilePointerEnum);
+
 	/*Reset position of buffer: */
 	femmodel_buffer=femmodel_buffer_ini;
@@ -687,5 +696,5 @@
 	/*Done, close file :*/
 	pfclose(restartfid,restartfilename);
-	
+
 	/*Free ressources: */
 	xDelete<char>(restartfilename);
@@ -700,14 +709,24 @@
 
 	if(marshall_direction==MARSHALLING_BACKWARD){
-		delete profiler; profiler=new Profiler();
-		delete loads; loads=new Loads();
-		delete materials; materials=new Materials();
-		delete parameters; parameters=new Parameters();
-		delete constraints; constraints=new Constraints();
-		delete results; results=new Results();
-		delete nodes; nodes=new Nodes();
-		delete vertices; vertices=new Vertices();
-		delete elements; elements=new Elements();
-		xDelete<int>(analysis_type_list);
+		delete this->profiler;
+		delete this->loads;
+		delete this->materials;
+		delete this->parameters;
+		delete this->constraints;
+		delete this->results;
+		delete this->nodes;
+		delete this->vertices;
+		delete this->elements;
+		xDelete<int>(this->analysis_type_list);
+
+		this->profiler = new Profiler();
+		this->loads = new Loads();
+		this->materials = new Materials();
+		this->parameters = new Parameters();
+		this->constraints = new Constraints();
+		this->results = new Results();
+		this->nodes = new Nodes();
+		this->vertices = new Vertices();
+		this->elements = new Elements();
 	}
 
@@ -719,29 +738,33 @@
 	MARSHALLING_DYNAMIC(analysis_type_list,int,nummodels);
 
-	profiler->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	loads->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	materials->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	parameters->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	constraints->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	results->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	nodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	vertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	elements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->profiler->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->loads->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->materials->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->parameters->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->constraints->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->results->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->nodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->vertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->elements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 
 	if(marshall_direction==MARSHALLING_BACKWARD){
 		//reset hooks for elements, loads and nodes:
-		elements->ResetHooks();
-		loads->ResetHooks();
-		materials->ResetHooks();
+		this->elements->ResetHooks();
+		this->loads->ResetHooks();
+		this->materials->ResetHooks();
 
 		//do the post-processing of the datasets to get an FemModel that can actually run analyses:
 		for(i=0;i<nummodels;i++){
-			analysis_type=analysis_type_list[i];
+			analysis_type=this->analysis_type_list[i];
 			SetCurrentConfiguration(analysis_type);
-			if(i==0) VerticesDofx(vertices,parameters); //only call once, we only have one set of vertices
-			SpcNodesx(nodes,constraints,parameters,analysis_type);
-			NodesDofx(nodes,parameters,analysis_type);
-			ConfigureObjectsx(elements,loads,nodes,vertices,materials,parameters);
+			if(i==0) VerticesDofx(this->vertices,this->parameters); //only call once, we only have one set of vertices
+			SpcNodesx(this->nodes,this->constraints,this->parameters,analysis_type);
+			NodesDofx(this->nodes,this->parameters,analysis_type);
+			ConfigureObjectsx(this->elements,this->loads,this->nodes,this->vertices,this->materials,this->parameters);
 		}
+
+		/*Reset current configuration: */
+		analysis_type=this->analysis_type_list[analysis_counter];
+		SetCurrentConfiguration(analysis_type);
 	}
 
Index: /issm/trunk-jpl/src/c/classes/Params/FileParam.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Params/FileParam.cpp	(revision 19260)
+++ /issm/trunk-jpl/src/c/classes/Params/FileParam.cpp	(revision 19261)
@@ -58,7 +58,8 @@
 
 	MARSHALLING_ENUM(FileParamEnum);
+	MARSHALLING(enum_type);
 	MARSHALLING(value);
 
-	if(marshall_direction==MARSHALLING_BACKWARD)value=NULL; //meaningless file pointer!
+	if(marshall_direction==MARSHALLING_BACKWARD) value=NULL; //meaningless file pointer!
 
 }
Index: /issm/trunk-jpl/src/c/datastructures/DataSet.cpp
===================================================================
--- /issm/trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 19260)
+++ /issm/trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 19261)
@@ -215,5 +215,7 @@
 				fileparam=new FileParam();
 				fileparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-				this->AddObject(fileparam);
+				delete fileparam;
+				/* No need to add this object, the pointer is not valid             
+				   The FemModel should reset all FileParams in the restart function */
 			}
 			else if(obj_enum==StringParamEnum){
