Index: ../trunk-jpl/src/c/bamg/Mesh.cpp
===================================================================
--- ../trunk-jpl/src/c/bamg/Mesh.cpp	(revision 18821)
+++ ../trunk-jpl/src/c/bamg/Mesh.cpp	(revision 18822)
@@ -2908,14 +2908,14 @@
 
 		// for all the new point
 		long iv=nbvold;
-		for (i=nbvold;i<nbv;i++){
+		for(i=nbvold;i<nbv;i++){
 			BamgVertex &vi=*orderedvertices[i];
 			vi.i=R2ToI2(vi.r);
 			vi.r=I2ToR2(vi.i);
 			double hx,hy;
 			vi.m.Box(hx,hy);
 			Icoor1 hi=(Icoor1) (hx*coefIcoor),hj=(Icoor1) (hy*coefIcoor);
-			if (!quadtree->ToClose(vi,seuil,hi,hj)){
+			if(!quadtree->ToClose(vi,seuil,hi,hj)){
 				// a good new point 
 				BamgVertex &vj = vertices[iv];
 				long  j=vj.ReferenceNumber; 
@@ -2940,6 +2940,9 @@
 				NbSwap += vj.Optim(1);          
 				iv++;
 			}
+			else{
+				vi.PreviousNumber = 0;
+			}
 		} 
 		if (verbose>3) {
 			_printf_("         number of new points: " << iv << "\n");
