Index: /branches/eam_branches/ipp-20150625/Ohana/src/dvomerge/src/LoadCatalog.c
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/dvomerge/src/LoadCatalog.c	(revision 38587)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/dvomerge/src/LoadCatalog.c	(revision 38588)
@@ -9,5 +9,7 @@
 
   // always load all of the data (if any exists)
-  catalog[0].catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT | DVO_LOAD_LENSING | DVO_LOAD_LENSOBJ | DVO_LOAD_STARPAR | DVO_LOAD_GALPHOT;
+  // XXXX TEMP HACK : skip GALPHOT
+  // XXXX catalog[0].catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT | DVO_LOAD_LENSING | DVO_LOAD_LENSOBJ | DVO_LOAD_STARPAR | DVO_LOAD_GALPHOT;
+  catalog[0].catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT | DVO_LOAD_LENSING | DVO_LOAD_LENSOBJ | DVO_LOAD_STARPAR;
   
   catalog[0].catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
Index: /branches/eam_branches/ipp-20150625/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c	(revision 38587)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c	(revision 38588)
@@ -177,14 +177,20 @@
       LoadCatalog (&outcatalog, outlist[0].regions[j], outcatalog.filename, "w", NsecfiltOutput);
 
-      // if no catalog already exists, use the input catalog to define the format or the specified format
       if (UPDATE_CATFORMAT) {
 	outcatalog.catformat = dvo_catalog_catformat (UPDATE_CATFORMAT);
       } else {
-	outcatalog.catformat = incatalog.catformat;
-      }
+	// IF no catalog already exists, use the input catalog to define the format
+	if (outcatalog.Naverage_disk == 0) {
+	  outcatalog.catformat = incatalog.catformat;
+	}
+      }
+
       if (UPDATE_CATCOMPRESS) {
 	outcatalog.catcompress = dvo_catalog_catcompress (UPDATE_CATCOMPRESS);
       } else {
-	outcatalog.catcompress = incatalog.catcompress;
+	// IF no catalog already exists, use the input catalog to define the compression
+	if (outcatalog.Naverage_disk == 0) {
+	  outcatalog.catcompress = incatalog.catcompress;
+	}
       }
 
@@ -282,25 +288,24 @@
 
     // options / arguments that can affect relastro_client -update-objects:
-    char command[DVO_MAX_PATH];
-    snprintf (command, DVO_MAX_PATH, "dvomerge_client %s into %s -hostID %d -hostdir %s -region %f %f %f %f -D ADDSTAR_RADIUS %f", 
-	      absinput, absoutput, group->hosts[i][0].hostID, group->hosts[i][0].pathname, 
-	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, RADIUS
-      );
-
-    char tmpline[DVO_MAX_PATH];
-    if (VERBOSE)             { snprintf (tmpline, DVO_MAX_PATH, "%s -v",                command); strcpy (command, tmpline); }
-    if (VERIFY)              { snprintf (tmpline, DVO_MAX_PATH, "%s -verify",           command); strcpy (command, tmpline); }
-    if (VERIFY_CATALOG_ONLY) { snprintf (tmpline, DVO_MAX_PATH, "%s -verify-catalogs",  command); strcpy (command, tmpline); }
-    if (REPLACE_BY_PHOTCODE) { snprintf (tmpline, DVO_MAX_PATH, "%s -replace",          command); strcpy (command, tmpline); }
-    if (REPLACE_TYCHO)       { snprintf (tmpline, DVO_MAX_PATH, "%s -replace-tycho",    command); strcpy (command, tmpline); }
-    if (PARALLEL_INPUT)      { snprintf (tmpline, DVO_MAX_PATH, "%s -parallel-input",   command); strcpy (command, tmpline); }
-    if (FORCE_MERGE)         { snprintf (tmpline, DVO_MAX_PATH, "%s -force-merge",      command); strcpy (command, tmpline); }
-    if (MATCHED_TABLES)      { snprintf (tmpline, DVO_MAX_PATH, "%s -matched-tables",   command); strcpy (command, tmpline); }
-    if (UPDATE_CATFORMAT)    { snprintf (tmpline, DVO_MAX_PATH, "%s -update-catformat %s", command, UPDATE_CATFORMAT); strcpy (command, tmpline); }
+    char *command = NULL;
+    strextend (&command, "dvomerge_client %s into %s -hostID %d -hostdir %s -region %f %f %f %f -D ADDSTAR_RADIUS %f", 
+	       absinput, absoutput, group->hosts[i][0].hostID, group->hosts[i][0].pathname, 
+	       UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, RADIUS);
+
+    if (VERBOSE)             { strextend (&command, "-v"); }
+    if (VERIFY)              { strextend (&command, "-verify"); }
+    if (VERIFY_CATALOG_ONLY) { strextend (&command, "-verify-catalogs"); }
+    if (REPLACE_BY_PHOTCODE) { strextend (&command, "-replace"); }
+    if (REPLACE_TYCHO)       { strextend (&command, "-replace-tycho"); }
+    if (PARALLEL_INPUT)      { strextend (&command, "-parallel-input"); }
+    if (FORCE_MERGE)         { strextend (&command, "-force-merge"); }
+    if (MATCHED_TABLES)      { strextend (&command, "-matched-tables"); }
+    if (UPDATE_CATFORMAT)    { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); }
+    if (UPDATE_CATCOMPRESS)  { strextend (&command, "-update-catcompress %s", UPDATE_CATCOMPRESS); }
 
     // add some config variables:
-    snprintf (tmpline, DVO_MAX_PATH, "%s -D CATMODE %s",    command, CATMODE);   strcpy (command, tmpline);
-    snprintf (tmpline, DVO_MAX_PATH, "%s -D CATFORMAT %s",  command, CATFORMAT); strcpy (command, tmpline);
-    snprintf (tmpline, DVO_MAX_PATH, "%s -D SKY_DEPTH %d",  command, SKY_DEPTH); strcpy (command, tmpline);
+    strextend (&command, "-D CATMODE %s", CATMODE);
+    strextend (&command, "-D CATFORMAT %s", CATFORMAT); 
+    strextend (&command, "-D SKY_DEPTH %d", SKY_DEPTH);
 
     fprintf (stderr, "command: %s\n", command);
Index: /branches/eam_branches/ipp-20150625/Ohana/src/dvomerge/src/dvorepairDeleteImagesByExternID.c
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/dvomerge/src/dvorepairDeleteImagesByExternID.c	(revision 38587)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/dvomerge/src/dvorepairDeleteImagesByExternID.c	(revision 38588)
@@ -279,5 +279,10 @@
 	gfits_scan(&cpmHeaderTBL, "NAXIS1", "%d", 1, &NbytesPerRow);
 
-	myAbort ("fix compression");
+	char compressMode[256];
+	if (gfits_scan (&cpmHeaderTBL, "DVO_CMP", "%s", 1, compressMode)) {
+	  if (strcmp (compressMode, "NONE")) {
+	    myAbort ("fix compression");
+	  }
+	}
 
 	// this function can only handle PS1_V5 and later formats
@@ -661,5 +666,12 @@
   gfits_scan (&cptHeaderPHU, "NSECFILT",     "%d",      1,  &Nsecfilt);
 
-  myAbort ("test for compression");
+  if (0) {
+    char compressMode[256];
+    if (gfits_scan (&cptHeaderTBL, "DVO_CMP", "%s", 1, compressMode)) {
+      if (strcmp (compressMode, "NONE")) {
+	myAbort ("fix compression");
+      }
+    }
+  }
 
   /* convert internal to external format */
Index: /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/average-ps1-v5.d
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/average-ps1-v5.d	(revision 38587)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/average-ps1-v5.d	(revision 38588)
@@ -26,5 +26,5 @@
 FIELD ChiSqAve,       CHISQ_POS,   float,           astrometry analysis chisq
 FIELD ChiSqPM,        CHISQ_PM,    float,           astrometry analysis chisq
-FIELD ChiSqPar,       CHISQ_PAP,   float,           astrometry analysis chisq
+FIELD ChiSqPar,       CHISQ_PLX,   float,           astrometry analysis chisq
 FIELD Tmean,          MEAN_EPOCH,  int,   	    mean epoch (PM,PAR ref),       unix time seconds
 FIELD Trange,         TIME_RANGE,  int,   	    mean epoch (PM,PAR ref),       unix time seconds
@@ -41,5 +41,5 @@
 FIELD Nlensing,       NLENSING,    unsigned short,  number of lensing measurements
 FIELD Nlensobj,       NLENSOBJ,    unsigned short,  number of lensing measurements
-FIELD Ngalphot,      NGALPHOT,   unsigned short,  number of galphot measurements
+FIELD Ngalphot,       NGALPHOT,    unsigned short,  number of galphot measurements
 
 FIELD measureOffset,  OFF_MEASURE,  int,   	    offset to first psf measurement
@@ -48,5 +48,5 @@
 FIELD lensobjOffset,  OFF_LENSOBJ,  int,   	    offset to mean lensing data
 FIELD starparOffset,  OFF_STARPAR,  int,   	    offset to stellar parameter data
-FIELD galphotOffset, OFF_GALPHOT, int,   	    offset to galphot object entry
+FIELD galphotOffset,  OFF_GALPHOT, int,   	    offset to galphot object entry
 
 FIELD refColorBlue,   REF_COLOR_BLUE, float,   	    color of astrometry ref stars
@@ -57,5 +57,5 @@
 FIELD projectionID,   PROJECTION_ID, short,	    ID of projection for primary skycell
 
-FIELD Nstarpar,       DUMMY,         short,         number of stellar parameter entries
+FIELD Nstarpar,       N_STAR_PAR,    short,         number of stellar parameter entries
 FIELD dummy,          DUMMY,         short,         unassigned bytes
 
Index: /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/measure-ps1-v5.d
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/measure-ps1-v5.d	(revision 38587)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/measure-ps1-v5.d	(revision 38588)
@@ -70,5 +70,5 @@
 FIELD psfNdof,        PSF_NDOF,      int,            psf degrees of freedom
 FIELD psfNpix,        PSF_NPIX,      int,            psf number of pixels
-FIELD photFlags2,     PHOT_FLAGS,    int,            flags supplied by photometry program
+FIELD photFlags2,     PHOT_FLAGS2,   int,            flags supplied by photometry program
 FIELD extNsigma,      EXT_NSIGMA,    float,          Nsigma deviation towards EXT
 
Index: /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/secfilt-ps1-v5.d
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/secfilt-ps1-v5.d	(revision 38587)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libautocode/def/secfilt-ps1-v5.d	(revision 38588)
@@ -10,8 +10,8 @@
 FIELD  Map,           MAG_AP,            float,    ave aperture mag in this band,         mags
 FIELD  dMap,          MAG_AP_ERR,        float,    ave aperture mag in this band,         mags
-FIELD  sMap,          MAG_AP_STDEV,    float,      standard deviation of ap mags,         mags
+FIELD  sMap,          MAG_AP_STDEV,      float,      standard deviation of ap mags,         mags
 FIELD  Mkron,         MAG_KRON,          float,    ave kron mag in this band,             mags
 FIELD  dMkron,        MAG_KRON_ERR,      float,    formal error on average kron mag,      mags
-FIELD  sMkron,        MAG_KRON_STDEV,  float,      standard deviation of kron mags,       mags
+FIELD  sMkron,        MAG_KRON_STDEV,    float,      standard deviation of kron mags,       mags
 				         
 # XXX I could add these fields to secfilt or calculate in dvopsps?
Index: /branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dbExtractImages.c
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dbExtractImages.c	(revision 38587)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/libdvo/src/dbExtractImages.c	(revision 38588)
@@ -236,7 +236,7 @@
     case IMAGE_EXPNAME_AS_INT:
       // XXX NOTE this does not handle gpc2 images
-      if ((image[N].name[0] == 'o') && (image->name[5] == 'g') && (image->name[10] == 'o')) {
-	int mjd  = atoi(&image->name[1]);
-	int Nexp = atoi(&image->name[6]);
+      if ((image[N].name[0] == 'o') && (image[N].name[5] == 'g') && (image[N].name[10] == 'o')) {
+	int mjd  = atoi(&image[N].name[1]);
+	int Nexp = atoi(&image[N].name[6]);
 	value.Int = mjd * 10000 + Nexp;
       }
Index: /branches/eam_branches/ipp-20150625/Ohana/src/opihi/cmd.data/uniq.c
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/opihi/cmd.data/uniq.c	(revision 38587)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/opihi/cmd.data/uniq.c	(revision 38588)
@@ -93,5 +93,5 @@
   // free up extra memory
   ResetVector (ovec, ivec->type, Nnew);
-  if (cvec) ResetVector (ovec, OPIHI_INT, Nnew);
+  if (cvec) ResetVector (cvec, OPIHI_INT, Nnew);
 
   return (TRUE);
Index: /branches/eam_branches/ipp-20150625/Ohana/src/opihi/pantasks/TaskOps.c
===================================================================
--- /branches/eam_branches/ipp-20150625/Ohana/src/opihi/pantasks/TaskOps.c	(revision 38587)
+++ /branches/eam_branches/ipp-20150625/Ohana/src/opihi/pantasks/TaskOps.c	(revision 38588)
@@ -22,5 +22,7 @@
 void FreeTasks () {
   int i;
-  for (i = 0; i < Ntasks; i++) {
+  int ntasks = Ntasks;
+  Ntasks = 0;
+  for (i = 0; i < ntasks; i++) {
     FreeTask (tasks[i]);
   }
