Index: trunk/Ohana/src/getstar/src/MatchImages.c
===================================================================
--- trunk/Ohana/src/getstar/src/MatchImages.c	(revision 38732)
+++ trunk/Ohana/src/getstar/src/MatchImages.c	(revision 38986)
@@ -29,4 +29,5 @@
   tcoords.crval1 = image[0].coords.crval1;
   tcoords.crval2 = image[0].coords.crval2;
+
   if (!strcmp (&image[0].coords.ctype[4], "-WRP")) {
     myAssert (image[0].coords.mosaic, "should already have tested this");
Index: trunk/Ohana/src/getstar/src/write_catalog.c
===================================================================
--- trunk/Ohana/src/getstar/src/write_catalog.c	(revision 38732)
+++ trunk/Ohana/src/getstar/src/write_catalog.c	(revision 38986)
@@ -5,7 +5,9 @@
   /* write out the selected stars */
   // XXX need to set the catalog boundaries by hand? RA0-RA1, DEC0-DEC1
-  dvo_catalog_save   (catalog, VERBOSE);
-  dvo_catalog_unlock (catalog);
-  dvo_catalog_free   (catalog);
+  SetProtect (TRUE);
+  if (!dvo_catalog_save (catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog->filename); exit (1); }
+  if (!dvo_catalog_unlock (catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog->filename); exit (1); }
+  SetProtect (FALSE);
+  dvo_catalog_free (catalog);
   fprintf (stderr, "SUCCESS\n");
   exit (0);
