Index: /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FitChip.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FitChip.c	(revision 37680)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FitChip.c	(revision 37681)
@@ -126,4 +126,8 @@
     }
 
+    if (!strcmp(image[0].name, "o5745g0403o.356777.cm.982487.smf[XY17.hdr]")) {
+      fprintf (stderr, "test image\n");
+    }
+
     for (i = 0; i < Nmatch; i++) {
       // if we have fitted the map above, Npolyterms needs to be -1 here:
@@ -320,4 +324,7 @@
   AstromOffsetMapFit (map, x, y, dY, N, FALSE);
 
+  AstromOffsetMapRepair (map, TRUE);
+  AstromOffsetMapRepair (map, FALSE);
+
   free (x);
   free (y);
@@ -338,6 +345,6 @@
   int i;
   for (i = 0; i < Npts; i++) {
-    fprintf (f, "%4d %10.6f %10.6f  %10.6f %10.6f  %9.2f %9.2f  %9.2f %9.2f  %9.4f\n", 
-	     i, raw[i].R, raw[i].D, raw[i].P, raw[i].Q, raw[i].L, raw[i].M, raw[i].X, raw[i].Y, raw[i].dPos);
+    fprintf (f, "%4d %10.6f %10.6f  %10.6f %10.6f  %9.2f %9.2f  %9.2f %9.2f  %9.4f %3d\n", 
+	     i, raw[i].R, raw[i].D, raw[i].P, raw[i].Q, raw[i].L, raw[i].M, raw[i].X, raw[i].Y, raw[i].dPos, raw[i].mask);
   }
   fclose (f);
