Index: trunk/Ohana/src/addstar/src/find_matches_closest_refstars.c
===================================================================
--- trunk/Ohana/src/addstar/src/find_matches_closest_refstars.c	(revision 27588)
+++ trunk/Ohana/src/addstar/src/find_matches_closest_refstars.c	(revision 27790)
@@ -159,5 +159,8 @@
     /** in replace mode, search for entry and replace values M, dM, R, D */
     // XXX this fails for unsorted catalogs, right?
-    if (options.replace && replace_match (&catalog[0].average[n], catalog[0].measure, stars[N])) continue;
+    if (options.replace && replace_match (&catalog[0].average[n], catalog[0].measure, stars[N])) {
+	i++;
+	continue;
+    }
 
     /* make sure there is space for next entry */
