Index: /trunk/Ohana/src/addstar/src/Shutdown.c
===================================================================
--- /trunk/Ohana/src/addstar/src/Shutdown.c	(revision 8457)
+++ /trunk/Ohana/src/addstar/src/Shutdown.c	(revision 8458)
@@ -12,5 +12,5 @@
   char *formatplus;
   
-  ALLOCATE (formatplus, char, strlen(format));
+  ALLOCATE (formatplus, char, strlen(format) + 2);
   strcpy (formatplus, format);
   strcat (formatplus, "\n");
Index: /trunk/Ohana/src/addstar/src/addstar.c
===================================================================
--- /trunk/Ohana/src/addstar/src/addstar.c	(revision 8457)
+++ /trunk/Ohana/src/addstar/src/addstar.c	(revision 8458)
@@ -94,7 +94,7 @@
     catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
     catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-    catalog.filename = skylist[0].filename[i];
+    catalog.filename  = skylist[0].filename[i];
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
-    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
+    catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
     if (options.update) catalog.catflags = LOAD_AVES | LOAD_MEAS_META | LOAD_MISS | LOAD_SECF;
 
@@ -104,6 +104,4 @@
       exit (2);
     }
-    dvo_catalog_test (&catalog, TRUE);
-
     // Nave_disk == 0 implies an empty catalog file
     // for only_match, skip empty catalogs
@@ -143,5 +141,4 @@
 	break;
     }
-    dvo_catalog_test (&catalog, TRUE);
 
     // write out catalog, if appropriate
@@ -151,5 +148,4 @@
       SetProtect (FALSE);
     }
-    dvo_catalog_test (&catalog, TRUE);
     dvo_catalog_unlock (&catalog);
     dvo_catalog_free (&catalog);
Index: /trunk/Ohana/src/addstar/src/find_matches.c
===================================================================
--- /trunk/Ohana/src/addstar/src/find_matches.c	(revision 8457)
+++ /trunk/Ohana/src/addstar/src/find_matches.c	(revision 8458)
@@ -18,4 +18,5 @@
 
   /* photcode data - must by of type DEP, (PRI, SEC) - probably should restrict to DEP */
+  // XXX : rely on catalog[0].Nsecfilt or GetPhotcodeNsecfilt??
   Nsecfilt = GetPhotcodeNsecfilt ();
   Nsec = (code[0].type == PHOT_DEP) ? GetPhotcodeNsec (code[0].equiv) : GetPhotcodeNsec (code[0].code);
@@ -333,5 +334,4 @@
   }
       
-  free (catalog[0].found);
   REALLOCATE (catalog[0].average, Average, Nave);
   REALLOCATE (catalog[0].measure, Measure, Nmeas);
Index: /trunk/Ohana/src/addstar/src/find_matches_refstars.c
===================================================================
--- /trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 8457)
+++ /trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 8458)
@@ -283,5 +283,4 @@
   free (catalog[0].found);
   REALLOCATE (catalog[0].average, Average, Nave);
-  REALLOCATE (catalog[0].measure, Measure, Nmeas);
 
   /* fix order of Measure (memory intensive, but fast) */
Index: /trunk/Ohana/src/addstar/src/getgsc.c
===================================================================
--- /trunk/Ohana/src/addstar/src/getgsc.c	(revision 8457)
+++ /trunk/Ohana/src/addstar/src/getgsc.c	(revision 8458)
@@ -25,5 +25,5 @@
   
   for (i = 0; i < skylist[0].Nregions; i++) {
-    // XXX : get from table gsc = rd_gsc ((char *)skylist[0].regions[i][0].filename, &Ngsc);
+    gsc = rd_gsc (skylist[0].filename[i], &Ngsc);
 
     REALLOCATE (stars, Stars, MAX (1, Nstars + Ngsc));
Index: /trunk/Ohana/src/addstar/src/gettycho.c
===================================================================
--- /trunk/Ohana/src/addstar/src/gettycho.c	(revision 8457)
+++ /trunk/Ohana/src/addstar/src/gettycho.c	(revision 8458)
@@ -34,4 +34,8 @@
     sprintf (filename, "%s/index.dat", TYCHO_DIR);
     tychoTable = SkyTableFromTychoIndex (filename, VERBOSE);
+    if (tychoTable == NULL) {
+      fprintf (stderr, "ERROR: problem loading tycho data\n");
+      exit (2);
+    }
   }
 
Index: /trunk/Ohana/src/addstar/src/gstars.c
===================================================================
--- /trunk/Ohana/src/addstar/src/gstars.c	(revision 8457)
+++ /trunk/Ohana/src/addstar/src/gstars.c	(revision 8458)
@@ -5,5 +5,5 @@
   FILE *f;
   int j, N, Nbytes, naxis;
-  int itmp, hour, min;
+  int itmp, hour, min, simple;
   char *name, *c, photname[64], line[80];
   double tmp, sec, dMs;
@@ -181,5 +181,6 @@
     naxis = 2;
     gfits_scan (&header, "NAXIS",  "%d", 1, &naxis);
-    if ((naxis == 0) && !TEXTMODE) {
+    gfits_scan (&header, "SIMPLE", "%t", 1, &simple);
+    if ((naxis == 0) && !TEXTMODE && simple) {
       Nbytes = gfits_matrix_size (&header);
       fseek (f, Nbytes, SEEK_CUR); 
