Index: /trunk/Ohana/src/addstar/src/find_matches.c
===================================================================
--- /trunk/Ohana/src/addstar/src/find_matches.c	(revision 17194)
+++ /trunk/Ohana/src/addstar/src/find_matches.c	(revision 17195)
@@ -92,5 +92,5 @@
 
   /* set up pointers for linked list of measure */
-  if (catalog[0].sorted) {
+  if (catalog[0].sorted && (catalog[0].Nmeasure == catalog[0].Nmeas_disk)) {
     next_meas = init_measure_links (catalog[0].average, Nave, catalog[0].measure, Nmeas);
   } else {
@@ -220,9 +220,9 @@
       /* this image star matches more than one catalog star */
       if (stars[N].found > -1) {
-	catalog[0].measure[stars[N].found].dbFlags |= BLEND_IMAGE;
-	catalog[0].measure[Nmeas].dbFlags |= BLEND_IMAGE;
+	catalog[0].measure[stars[N].found].dbFlags |= ID_MEAS_BLEND_MEAS;
+	catalog[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_MEAS;
       } 
       if (stars[N].found == -2) { /* this image star matches a catalog star on a neighboring catalog */
-	catalog[0].measure[Nmeas].dbFlags |= BLEND_IMAGE_NEIGHBOR;
+	catalog[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_MEAS_X;
       } 
       if (stars[N].found == -1) { /* this image star matches only this catalog star */
@@ -231,6 +231,6 @@
       /* this catalog star matches more than one image star */
       if (catalog[0].found[n] > -1) {
-	catalog[0].measure[catalog[0].found[n]].dbFlags |= BLEND_CATALOG;
-	catalog[0].measure[Nmeas].dbFlags |= BLEND_CATALOG;
+	catalog[0].measure[catalog[0].found[n]].dbFlags |= ID_MEAS_BLEND_OBJ;
+	catalog[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_OBJ;
       } else {
 	catalog[0].found[n] = Nmeas;
Index: /trunk/Ohana/src/addstar/src/find_matches_refstars.c
===================================================================
--- /trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 17194)
+++ /trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 17195)
@@ -187,9 +187,9 @@
       /* this image star matches more than one catalog star */
       if (stars[N][0].found > -1) {
-	catalog[0].measure[stars[N][0].found].dbFlags |= BLEND_IMAGE;
-	catalog[0].measure[Nmeas].dbFlags |= BLEND_IMAGE;
+	catalog[0].measure[stars[N][0].found].dbFlags |= ID_MEAS_BLEND_MEAS;
+	catalog[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_MEAS;
       } 
       if (stars[N][0].found == -2) { /* this image star matches a catalog star on a neighboring catalog */
-	catalog[0].measure[Nmeas].dbFlags |= BLEND_IMAGE_NEIGHBOR;
+	catalog[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_MEAS_X;
       } 
       if (stars[N][0].found == -1) { /* this image star matches only this catalog star */
@@ -198,6 +198,6 @@
       /* this catalog star matches more than one image star */
       if (catalog[0].found[n] > -1) {
-	catalog[0].measure[catalog[0].found[n]].dbFlags |= BLEND_CATALOG;
-	catalog[0].measure[Nmeas].dbFlags |= BLEND_CATALOG;
+	catalog[0].measure[catalog[0].found[n]].dbFlags |= ID_MEAS_BLEND_OBJ;
+	catalog[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_OBJ;
       } else {
 	catalog[0].found[n] = Nmeas;
