Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 15963)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 15964)
@@ -11253,5 +11253,5 @@
 					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
 				}
-				else if(migration_style==SoftMigrationEnum && reCast<int,IssmDouble>(sheet_ungrounding[nodes[i]->Sid()])){
+				else if(migration_style==SoftMigrationEnum && reCast<int,IssmDouble>(sheet_ungrounding[vertices[i]->Sid()])){
 					s[i]        = (1-density)*h[i];
 					b[i]        = -density*h[i];
@@ -11341,5 +11341,5 @@
 			if(bed_hydro>r[i]){
 				/*Vertex that could potentially unground, flag it*/
-				potential_ungrounding->SetValue(nodes[i]->Sid(),1,INS_VAL);
+				potential_ungrounding->SetValue(vertices[i]->Sid(),1,INS_VAL);
 			}
 		}
@@ -11356,8 +11356,8 @@
 	for(i=0;i<NUMVERTICES;i++){
 		if (reCast<bool,IssmDouble>(vertices_potentially_ungrounding[nodes[i]->Sid()])){
-			vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL);
+			vec_nodes_on_iceshelf->SetValue(vertices[i]->Sid(),1,INS_VAL);
 
 			/*If node was not on ice shelf, we flipped*/
-			if(nodes_on_iceshelf[nodes[i]->Sid()]==0){
+			if(nodes_on_iceshelf[vertices[i]->Sid()]==0){
 				nflipped++;
 			}
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 15963)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 15964)
@@ -7312,5 +7312,5 @@
 #ifdef _HAVE_GROUNDINGLINE_
 /*FUNCTION Tria::MigrateGroundingLine{{{*/
-void  Tria::MigrateGroundingLine(IssmDouble* sheet_ungrounding){
+void  Tria::MigrateGroundingLine(IssmDouble* phi_ungrounding){
 
 	int        i,migration_style;
@@ -7363,5 +7363,6 @@
 					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
 				}
-				else if(migration_style==SoftMigrationEnum && reCast<bool>(sheet_ungrounding[nodes[i]->Sid()])){
+				else if(migration_style==SoftMigrationEnum && reCast<bool>(sheet_ungrounding[vertices[i]->Sid()])){
+				//else if(migration_style==SoftMigrationEnum && phi_ungrounding[vertices[i]->Sid()]<0.){
 					s[i]        = (1-density)*h[i];
 					b[i]        = -density*h[i];
@@ -7413,5 +7414,6 @@
 		if(migration_style==SoftMigrationEnum){
 			bed_hydro=-density*h[i];
-			if(phi[i]<0. || bed_hydro<=r[i] || reCast<bool>(sheet_ungrounding[nodes[i]->Sid()])){
+			//if(phi[i]<0. || bed_hydro<=r[i] || phi_ungrounding[vertices[i]->Sid()]<0.){
+			if(phi[i]<0. || bed_hydro<=r[i] || reCast<bool>(sheet_ungrounding[vertices[i]->Sid()])){
 				phi[i]=h[i]+r[i]/density;
 			}
@@ -7444,5 +7446,5 @@
 			if(bed_hydro>r[i]){
 				/*Vertex that could potentially unground, flag it*/
-				potential_ungrounding->SetValue(nodes[i]->Sid(),1,INS_VAL);
+				potential_ungrounding->SetValue(vertices[i]->Sid(),1,INS_VAL);
 			}
 		}
@@ -7458,9 +7460,9 @@
 	/*Go through nodes, and whoever is on the potential_ungrounding, ends up in nodes_on_iceshelf: */
 	for(i=0;i<3;i++){
-		if (reCast<bool>(vertices_potentially_ungrounding[nodes[i]->Sid()])){
-			vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL);
+		if (reCast<bool>(vertices_potentially_ungrounding[vertices[i]->Sid()])){
+			vec_nodes_on_iceshelf->SetValue(vertices[i]->Sid(),1,INS_VAL);
 
 			/*If node was not on ice shelf, we flipped*/
-			if(nodes_on_iceshelf[nodes[i]->Sid()]==0){
+			if(nodes_on_iceshelf[vertices[i]->Sid()]==0){
 				nflipped++;
 			}
