Index: /issm/trunk/src/c/objects/Hook.cpp
===================================================================
--- /issm/trunk/src/c/objects/Hook.cpp	(revision 5451)
+++ /issm/trunk/src/c/objects/Hook.cpp	(revision 5452)
@@ -79,12 +79,8 @@
 		printf("      num=%i\n",this->num);
 		printf("      ids: ");
-		for (i=0;i<this->num;i++){
-			printf("%i ",this->ids[i]);
-		}
+		for (i=0;i<this->num;i++) printf("%i ",this->ids[i]);
 		printf("\n");
 		printf("      offsets: ");
-		for (i=0;i<this->num;i++){
-			printf("%i ",this->offsets[i]);
-		}
+		for (i=0;i<this->num;i++) printf("%i ",this->offsets[i]);
 		printf("\n");
 	}
@@ -102,12 +98,8 @@
 		printf("      num=%i\n",this->num);
 		printf("      ids: ");
-		for (i=0;i<this->num;i++){
-			printf("%i ",this->ids[i]);
-		}
+		for (i=0;i<this->num;i++) printf("%i ",this->ids[i]);
 		printf("\n");
 		printf("      offsets: ");
-		for (i=0;i<this->num;i++){
-			printf("%i ",this->offsets[i]);
-		}
+		for (i=0;i<this->num;i++) printf("%i ",this->offsets[i]);
 		printf("\n");
 		if (!objects) printf("      warning: object not hooked yet\n");
@@ -116,5 +108,6 @@
 			for (i=0;i<this->num;i++){
 				printf("         object %i\n",i);
-				objects[i]->DeepEcho();
+				if(objects[i]) objects[i]->DeepEcho();
+				else           printf("            no object hooked yet (not configured)\n");
 			}
 		}
Index: /issm/trunk/src/c/objects/Loads/Numericalflux.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 5451)
+++ /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 5452)
@@ -34,5 +34,5 @@
 	int  i1,i2;
 	int  j;
-	int  pos1,pos2;
+	int  pos1,pos2,pos3,pos4;
 	int  num_nodes;
 	int  num_elems;
@@ -77,31 +77,34 @@
 
 		/*2: Get the column where these ids are located in the index*/
+		pos1=pos2=pos3=pos4=UNDEF;
+		for(j=0;j<3;j++){
+			if (iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1;
+			if (iomodel->elements[3*(e1-1)+j]==i2) pos2=j+1;
+			if (iomodel->elements[3*(e2-1)+j]==i1) pos3=j+1;
+			if (iomodel->elements[3*(e2-1)+j]==i2) pos4=j+1;
+		}
+		ISSMASSERT(pos1!=UNDEF && pos2!=UNDEF && pos3!=UNDEF && pos4!=UNDEF);
+
+		/*3: We have the id of the elements and the position of the vertices in the index
+		 * we can compute their dofs!*/
+		numericalflux_node_ids[0]=iomodel->nodecounter+3*(e1-1)+pos1;
+		numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+pos2;
+		numericalflux_node_ids[2]=iomodel->nodecounter+3*(e2-1)+pos3;
+		numericalflux_node_ids[3]=iomodel->nodecounter+3*(e2-1)+pos4;
+	}
+	else{
+
+		/*2: Get the column where these ids are located in the index*/
 		pos1=pos2=UNDEF;
 		for(j=0;j<3;j++){
 			if (iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1;
-			if (iomodel->elements[3*(e2-1)+j]==i1) pos2=j+1;
+			if (iomodel->elements[3*(e1-1)+j]==i2) pos2=j+1;
 		}
 		ISSMASSERT(pos1!=UNDEF && pos2!=UNDEF);
-
-		/*3: We have the id of the elements and the position of the vertices in the index
-		 * we can compute their dofs!*/
-		numericalflux_node_ids[0]=iomodel->nodecounter+3*(e1-1)+pos1;       //ex: 1 2 3
-		numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+(pos1%3)+1; //ex: 2 3 1
-		numericalflux_node_ids[2]=iomodel->nodecounter+3*(e2-1)+pos2;           //ex: 1 2 3
-		numericalflux_node_ids[3]=iomodel->nodecounter+3*(e2-1)+((pos2+1)%3)+1; //ex: 3 1 2
-	}
-	else{
-
-		/*2: Get the column where these ids are located in the index*/
-		pos1==UNDEF;
-		for(j=0;j<3;j++){
-			if (iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1;
-		}
-		ISSMASSERT(pos1!=UNDEF);
 
 		/*3: We have the id of the elements and the position of the vertices in the index
 		 * we can compute their dofs!*/
 		numericalflux_node_ids[0]=iomodel->nodecounter+3*(e1-1)+pos1;
-		numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+(pos1%3)+1;
+		numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+pos2;
 	}
 
@@ -134,5 +137,11 @@
 /*FUNCTION Numericalflux::Echo {{{1*/
 void Numericalflux::Echo(void){
-	this->DeepEcho();
+	printf("Numericalflux:\n");
+	printf("   id: %i\n",id);
+	printf("   analysis_type: %s\n",EnumToString(analysis_type));
+	hnodes->Echo();
+	helement->Echo();
+	printf("   parameters: %p\n",parameters);
+	printf("   inputs: %p\n",inputs);
 }
 /*}}}*/
@@ -146,5 +155,8 @@
 	helement->DeepEcho();
 	printf("   parameters\n");
-	parameters->DeepEcho();
+	if(parameters)
+	 parameters->DeepEcho();
+	else
+	 printf("      NULL\n");
 	printf("   inputs\n");
 	inputs->DeepEcho();
@@ -395,8 +407,8 @@
 
 	/*dynamic objects pointed to by hooks: */
-	Node**  nodes=NULL;
-	Tria*   tria=NULL;
-	Input*  vxaverage_input=NULL;
-	Input*  vyaverage_input=NULL;
+	Node  **nodes           = NULL;
+	Tria   *tria            = NULL;
+	Input  *vxaverage_input = NULL;
+	Input  *vyaverage_input = NULL;
 
 	/*Retrieve parameters: */
