Index: /trunk/Ohana/src/addstar/src/find_matches_refstars.c
===================================================================
--- /trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 26399)
+++ /trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 26400)
@@ -297,6 +297,10 @@
 
       stars[N][0].found = Nmeas;
-      next_meas[Nmeas] = -1;
-      Nmeas ++;
+      next_meas[Nmeas] = -1;  // initial value here, update below
+      Nmeas ++; 
+    }
+
+    for (j = 0; j < NREFSTAR_GROUP - 1; j++) {
+	next_meas[Nmeas - NREFSTAR_GROUP + j] = Nmeas - NREFSTAR_GROUP + j + 1;
     }
     Nave ++;
