Index: /issm/trunk/src/c/objects/DofIndexing.cpp
===================================================================
--- /issm/trunk/src/c/objects/DofIndexing.cpp	(revision 5791)
+++ /issm/trunk/src/c/objects/DofIndexing.cpp	(revision 5792)
@@ -50,5 +50,5 @@
 	this->clone=in->clone;
 
-	if(this->gsize>0 && this->gsize!=UNDEF){
+	if(this->gsize>0){
 		this->f_set=(bool*)xmalloc(this->gsize*sizeof(bool));
 		this->s_set=(bool*)xmalloc(this->gsize*sizeof(bool));
@@ -67,5 +67,5 @@
 	if(this->ssize>0 && this->ssize!=UNDEF)this->sdoflist=(int*)xmalloc(this->ssize*sizeof(int)); else this->sdoflist=NULL;
 
-	if(this->gsize>0 && this->gsize!=UNDEF){
+	if(this->gsize>0){
 		memcpy(this->f_set,in->f_set,this->gsize*sizeof(bool));
 		memcpy(this->s_set,in->s_set,this->gsize*sizeof(bool));
@@ -101,5 +101,5 @@
 
 	/*allocate: */
-	if(this->gsize>0 && this->gsize!=UNDEF){
+	if(this->gsize>0){
 		this->f_set=(bool*)xmalloc(this->gsize*sizeof(bool));
 		this->s_set=(bool*)xmalloc(this->gsize*sizeof(bool));
@@ -115,4 +115,5 @@
 		if(this->doftype)this->doftype[i]=in_doftype[i];
 		this->svalues[i]=0; //0 constraint is the default value
+		this->gdoflist[i]=UNDEF;
 	}
 }
@@ -228,5 +229,5 @@
 	
 	/*Allocate: */
-	if(this->gsize>0 && this->gsize!=UNDEF){
+	if(this->gsize>0){
 		this->f_set=(bool*)xmalloc(this->gsize*sizeof(bool));
 		this->s_set=(bool*)xmalloc(this->gsize*sizeof(bool));
@@ -243,9 +244,9 @@
 		this->gdoflist=NULL;
 	}
-	if(this->fsize>0 && this->fsize!=UNDEF)
+	if(this->fsize>0)
 	 this->fdoflist=(int*)xmalloc(this->fsize*sizeof(int));
 	else
 	 this->fdoflist=NULL;
-	if(this->ssize>0 && this->ssize!=UNDEF)
+	if(this->ssize>0)
 	 this->sdoflist=(int*)xmalloc(this->ssize*sizeof(int));
 	else
@@ -253,10 +254,10 @@
 
 	/*Copy arrays: */
-	if(this->gsize>0 && this->gsize!=UNDEF){
+	if(this->gsize>0){
 		memcpy(f_set,marshalled_dataset,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
 		memcpy(s_set,marshalled_dataset,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
-		memcpy(this->svalues,marshalled_dataset,this->gsize*sizeof(double));marshalled_dataset+=this->gsize*sizeof(double);
-		if(flagdoftype){ memcpy(doftype,marshalled_dataset,gsize*sizeof(int));marshalled_dataset+=gsize*sizeof(int); }
-		memcpy(this->gdoflist,marshalled_dataset,this->gsize*sizeof(int));marshalled_dataset+=this->gsize*sizeof(int);
+		memcpy(svalues,marshalled_dataset,gsize*sizeof(double));marshalled_dataset+=gsize*sizeof(double);
+		if(flagdoftype){memcpy(doftype,marshalled_dataset,gsize*sizeof(int));marshalled_dataset+=gsize*sizeof(int); }
+		memcpy(gdoflist,marshalled_dataset,gsize*sizeof(int));marshalled_dataset+=gsize*sizeof(int);
 	}
 	
@@ -296,5 +297,5 @@
 	memcpy(marshalled_dataset,&clone,sizeof(clone));marshalled_dataset+=sizeof(clone);
 	
-	if(this->gsize>0 && this->gsize!=UNDEF){
+	if(this->gsize>0){
 		memcpy(marshalled_dataset,f_set,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
 		memcpy(marshalled_dataset,s_set,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
@@ -316,5 +317,5 @@
 
 	size+=4*sizeof(int)+sizeof(bool);
-	if(this->gsize>0 && this->gsize!=UNDEF){
+	if(this->gsize>0){
 		size+= 2*this->gsize*sizeof(bool)+
 			   this->gsize*sizeof(double)+
Index: /issm/trunk/src/c/objects/Node.cpp
===================================================================
--- /issm/trunk/src/c/objects/Node.cpp	(revision 5791)
+++ /issm/trunk/src/c/objects/Node.cpp	(revision 5792)
@@ -566,6 +566,8 @@
 		count=0;
 		for(i=0;i<this->indexing.gsize;i++){
-			if(this->indexing.s_set[i])values[count]=this->indexing.svalues[i];
-			count++;
+			if(this->indexing.s_set[i]){
+				values[count]=this->indexing.svalues[i];
+				count++;
+			}
 		}
 		
