Index: /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h	(revision 19218)
+++ /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h	(revision 19219)
@@ -17,5 +17,4 @@
 		memcpy(*pmarshalled_data,&enum_type,sizeof(int));\
 		*pmarshalled_data+=sizeof(int);\
-		*pmarshalled_data_size+=sizeof(int);\
 	}\
 	else if(marshall_direction==MARSHALLING_SIZE){\
@@ -23,4 +22,5 @@
 	}\
 	else if(marshall_direction==MARSHALLING_BACKWARD){\
+		*pmarshalled_data+=sizeof(int);\
 	}\
 	else _error_("Wrong direction during the Marshall process");\
@@ -32,5 +32,4 @@
 		memcpy(*pmarshalled_data,&FIELD,sizeof(FIELD));\
 		*pmarshalled_data+=sizeof(FIELD);\
-		*pmarshalled_data_size+=sizeof(FIELD);\
 	}\
 	else if(marshall_direction==MARSHALLING_SIZE){\
@@ -49,5 +48,4 @@
 		memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\
 		*pmarshalled_data+=SIZE*sizeof(TYPE);\
-		*pmarshalled_data_size+=SIZE*sizeof(TYPE);\
 	}\
 	else if(marshall_direction==MARSHALLING_SIZE){\
@@ -63,18 +61,25 @@
 #define MARSHALLING_DYNAMIC(FIELD,TYPE,SIZE) \
 	\
-	if(marshall_direction==MARSHALLING_FORWARD){\
-		memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\
-		*pmarshalled_data+=SIZE*sizeof(TYPE);\
-		*pmarshalled_data_size+=SIZE*sizeof(TYPE);\
-	}\
-	else if(marshall_direction==MARSHALLING_SIZE){\
-		*pmarshalled_data_size+=SIZE*sizeof(TYPE);\
-	}\
-	else if(marshall_direction==MARSHALLING_BACKWARD){\
-		FIELD=xNew<TYPE>(SIZE);\
-		memcpy(FIELD,*pmarshalled_data,SIZE*sizeof(TYPE));\
-		*pmarshalled_data+=SIZE*sizeof(TYPE);\
-	}\
-	else _error_("Wrong direction during the Marshall process");
+	{\
+		bool field_null=true;\
+		if (FIELD)field_null=false;\
+		MARSHALLING(field_null);\
+		\
+		if(!field_null){\
+			if(marshall_direction==MARSHALLING_FORWARD){\
+					memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\
+					*pmarshalled_data+=SIZE*sizeof(TYPE);\
+			}\
+			else if(marshall_direction==MARSHALLING_SIZE){\
+				*pmarshalled_data_size+=SIZE*sizeof(TYPE);\
+			}\
+			else if(marshall_direction==MARSHALLING_BACKWARD){\
+				FIELD=xNew<TYPE>(SIZE);\
+				memcpy(FIELD,*pmarshalled_data,SIZE*sizeof(TYPE));\
+				*pmarshalled_data+=SIZE*sizeof(TYPE);\
+			}\
+			else _error_("Wrong direction during the Marshall process");\
+		}\
+	}
 
 #endif	
