Index: /branches/eam_branches/ohana.20150429/src/relastro/include/relastro.h
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relastro/include/relastro.h	(revision 38381)
+++ /branches/eam_branches/ohana.20150429/src/relastro/include/relastro.h	(revision 38382)
@@ -539,5 +539,4 @@
 int hpm_objects (SkyRegion *region, Catalog *catalog);
 
-int strextend (char *input, char *format,...);
 int launch_region_hosts (RegionHostTable *regionHosts);
 
@@ -591,6 +590,4 @@
 float getColorBlue (off_t meas, int cat);
 float getColorRed (off_t meas, int cat);
-
-int strextend (char *input, char *format,...);
 
 int areImagesLoaded ();
Index: /branches/eam_branches/ohana.20150429/src/relastro/src/UpdateObjectOffsets.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relastro/src/UpdateObjectOffsets.c	(revision 38381)
+++ /branches/eam_branches/ohana.20150429/src/relastro/src/UpdateObjectOffsets.c	(revision 38382)
@@ -152,49 +152,49 @@
     // MaxDensityUse, MaxDensityValue
 
-    char command[1024];
-    snprintf (command, 1024, "relastro_client -update-offsets -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -minerror %f", 
+    char *command = NULL;
+    strextend (&command, "relastro_client -update-offsets -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -minerror %f", 
 	      group->hosts[i][0].hostID, CATDIR, group->hosts[i][0].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, MIN_ERROR);
 
-    if (FIT_MODE == FIT_PM_ONLY)  	 strextend (command, "-pm");
-    if (FIT_MODE == FIT_PAR_ONLY) 	 strextend (command, "-par");
-    if (FIT_MODE == FIT_PM_AND_PAR)      strextend (command, "-pmpar");
-
-    if (VERBOSE)       strextend (command, "-v");
-    if (VERBOSE2)      strextend (command, "-vv");
-    if (RESET)         strextend (command, "-reset");
-    if (UPDATE)        strextend (command, "-update");
-
-    if (RESET_BAD_IMAGES) strextend (command, "-reset-bad-images");
-
-    if (ImagSelect)    strextend (command, "-instmag %f %f", ImagMin, ImagMax);
-    if (MaxDensityUse) strextend (command, "-max-density %f", MaxDensityValue);
-    
-    if (USE_BASIC_CHECK) strextend (command, "-basic-image-search");
-    if (FlagOutlier)     strextend (command, "-clip %d", CLIP_THRESH);
-    if (ExcludeBogus)    strextend (command, "-exclude-bogus %f", ExcludeBogusRadius);
-    
-    if (USE_FIXED_PIXCOORDS) strextend (command, "-D USE_FIXED_PIXCOORDS 1"); 
-
-    if (PHOTCODE_KEEP_LIST) strextend (command, "+photcode %s", PHOTCODE_KEEP_LIST);
-    if (PHOTCODE_SKIP_LIST) strextend (command, "-photcode %s", PHOTCODE_SKIP_LIST);
-    if (PhotFlagSelect)     strextend (command, "+photflags"); 
-    if (PhotFlagBad)        strextend (command, "+photflagbad %d", PhotFlagBad);
-    if (PhotFlagPoor)       strextend (command, "+photflagpoor %d", PhotFlagPoor);
+    if (FIT_MODE == FIT_PM_ONLY)  	 strextend (&command, "-pm");
+    if (FIT_MODE == FIT_PAR_ONLY) 	 strextend (&command, "-par");
+    if (FIT_MODE == FIT_PM_AND_PAR)      strextend (&command, "-pmpar");
+
+    if (VERBOSE)       strextend (&command, "-v");
+    if (VERBOSE2)      strextend (&command, "-vv");
+    if (RESET)         strextend (&command, "-reset");
+    if (UPDATE)        strextend (&command, "-update");
+
+    if (RESET_BAD_IMAGES) strextend (&command, "-reset-bad-images");
+
+    if (ImagSelect)    strextend (&command, "-instmag %f %f", ImagMin, ImagMax);
+    if (MaxDensityUse) strextend (&command, "-max-density %f", MaxDensityValue);
+    
+    if (USE_BASIC_CHECK) strextend (&command, "-basic-image-search");
+    if (FlagOutlier)     strextend (&command, "-clip %d", CLIP_THRESH);
+    if (ExcludeBogus)    strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius);
+    
+    if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); 
+
+    if (PHOTCODE_KEEP_LIST) strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST);
+    if (PHOTCODE_SKIP_LIST) strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST);
+    if (PhotFlagSelect)     strextend (&command, "+photflags"); 
+    if (PhotFlagBad)        strextend (&command, "+photflagbad %d", PhotFlagBad);
+    if (PhotFlagPoor)       strextend (&command, "+photflagpoor %d", PhotFlagPoor);
     // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
 
     if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) {
-      strextend (command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 
+      strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 
     }
     if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) {
-      strextend (command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 
-    }
-
-    if (MinBadQF > 0.0)        strextend (command, "-min-bad-psfqf %f", MinBadQF); 
-    if (MaxMeanOffset != 10.0) strextend (command, "-max-mean-offset  %f", MaxMeanOffset);
+      strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 
+    }
+
+    if (MinBadQF > 0.0)        strextend (&command, "-min-bad-psfqf %f", MinBadQF); 
+    if (MaxMeanOffset != 10.0) strextend (&command, "-max-mean-offset  %f", MaxMeanOffset);
 
     if (TimeSelect) { 
       char *tstart = ohana_sec_to_date (TSTART);
       char *tstop  = ohana_sec_to_date (TSTOP);
-      strextend (command, "-time %s %s", tstart, tstop); 
+      strextend (&command, "-time %s %s", tstart, tstop); 
       free (tstart);
       free (tstop);
@@ -270,49 +270,49 @@
     // MaxDensityUse, MaxDensityValue
 
-    char command[1024];
-    snprintf (command, 1024, "relastro_client -update-offsets -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -minerror %f", 
+    char *command = NULL;
+    strextend (&command, "relastro_client -update-offsets -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -minerror %f", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, MIN_ERROR);
 
-    if (FIT_MODE == FIT_PM_ONLY)  	 strextend (command, "-pm");
-    if (FIT_MODE == FIT_PAR_ONLY) 	 strextend (command, "-par");
-    if (FIT_MODE == FIT_PM_AND_PAR)      strextend (command, "-pmpar");
-
-    if (VERBOSE)       strextend (command, "-v");
-    if (VERBOSE2)      strextend (command, "-vv");
-    if (RESET)         strextend (command, "-reset");
-    if (UPDATE)        strextend (command, "-update");
-
-    if (RESET_BAD_IMAGES) strextend (command, "-reset-bad-images");
-
-    if (ImagSelect)    strextend (command, "-instmag %f %f", ImagMin, ImagMax);
-    if (MaxDensityUse) strextend (command, "-max-density %f", MaxDensityValue);
-    
-    if (USE_BASIC_CHECK) strextend (command, "-basic-image-search");
-    if (FlagOutlier)     strextend (command, "-clip %d", CLIP_THRESH);
-    if (ExcludeBogus)    strextend (command, "-exclude-bogus %f", ExcludeBogusRadius);
-    
-    if (USE_FIXED_PIXCOORDS) strextend (command, "-D USE_FIXED_PIXCOORDS 1"); 
-
-    if (PHOTCODE_KEEP_LIST) strextend (command, "+photcode %s", PHOTCODE_KEEP_LIST);
-    if (PHOTCODE_SKIP_LIST) strextend (command, "-photcode %s", PHOTCODE_SKIP_LIST);
-    if (PhotFlagSelect)     strextend (command, "+photflags"); 
-    if (PhotFlagBad)        strextend (command, "+photflagbad %d", PhotFlagBad);
-    if (PhotFlagPoor)       strextend (command, "+photflagpoor %d", PhotFlagPoor);
+    if (FIT_MODE == FIT_PM_ONLY)  	 strextend (&command, "-pm");
+    if (FIT_MODE == FIT_PAR_ONLY) 	 strextend (&command, "-par");
+    if (FIT_MODE == FIT_PM_AND_PAR)      strextend (&command, "-pmpar");
+
+    if (VERBOSE)       strextend (&command, "-v");
+    if (VERBOSE2)      strextend (&command, "-vv");
+    if (RESET)         strextend (&command, "-reset");
+    if (UPDATE)        strextend (&command, "-update");
+
+    if (RESET_BAD_IMAGES) strextend (&command, "-reset-bad-images");
+
+    if (ImagSelect)    strextend (&command, "-instmag %f %f", ImagMin, ImagMax);
+    if (MaxDensityUse) strextend (&command, "-max-density %f", MaxDensityValue);
+    
+    if (USE_BASIC_CHECK) strextend (&command, "-basic-image-search");
+    if (FlagOutlier)     strextend (&command, "-clip %d", CLIP_THRESH);
+    if (ExcludeBogus)    strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius);
+    
+    if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); 
+
+    if (PHOTCODE_KEEP_LIST) strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST);
+    if (PHOTCODE_SKIP_LIST) strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST);
+    if (PhotFlagSelect)     strextend (&command, "+photflags"); 
+    if (PhotFlagBad)        strextend (&command, "+photflagbad %d", PhotFlagBad);
+    if (PhotFlagPoor)       strextend (&command, "+photflagpoor %d", PhotFlagPoor);
     // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
 
     if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) {
-      strextend (command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 
+      strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 
     }
     if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) {
-      strextend (command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 
-    }
-
-    if (MinBadQF > 0.0)        strextend (command, "-min-bad-psfqf %f", MinBadQF); 
-    if (MaxMeanOffset != 10.0) strextend (command, "-max-mean-offset  %f", MaxMeanOffset);
+      strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 
+    }
+
+    if (MinBadQF > 0.0)        strextend (&command, "-min-bad-psfqf %f", MinBadQF); 
+    if (MaxMeanOffset != 10.0) strextend (&command, "-max-mean-offset  %f", MaxMeanOffset);
 
     if (TimeSelect) { 
       char *tstart = ohana_sec_to_date (TSTART);
       char *tstop  = ohana_sec_to_date (TSTOP);
-      strextend (command, "-time %s %s", tstart, tstop); 
+      strextend (&command, "-time %s %s", tstart, tstop); 
       free (tstart);
       free (tstop);
Index: /branches/eam_branches/ohana.20150429/src/relastro/src/args.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relastro/src/args.c	(revision 38381)
+++ /branches/eam_branches/ohana.20150429/src/relastro/src/args.c	(revision 38382)
@@ -959,14 +959,2 @@
 }
 
-int strextend (char *input, char *format,...) {
-
-  char tmpextra[1024], tmpline[1024];
-  va_list argp;
-
-  va_start (argp, format);
-  vsnprintf (tmpextra, 1024, format, argp);
-  snprintf (tmpline, 1024, "%s %s", input, tmpextra);
-  strcpy (input, tmpline);
-
-  return TRUE;
-}
Index: /branches/eam_branches/ohana.20150429/src/relastro/src/launch_region_hosts.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relastro/src/launch_region_hosts.c	(revision 38381)
+++ /branches/eam_branches/ohana.20150429/src/relastro/src/launch_region_hosts.c	(revision 38382)
@@ -77,24 +77,24 @@
     }
 
-    char command[1024];
-    snprintf (command, 1024, "relastro -parallel-images %s", filename);
-    strextend (command, "-region-hosts %s", REGION_FILE);
-    strextend (command, "-region-hostID %d", host->hostID);
-    strextend (command, "-D CATDIR %s", CATDIR);
-    strextend (command, "-region %f %f %f %f", host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat);
-    strextend (command, "-statmode %s", STATMODE);
-    strextend (command, "-minerror %f", MIN_ERROR);
-    strextend (command, "-nloop %d", NLOOP);
-    strextend (command, "-threads %d", NTHREADS);
+    char *command = NULL;
+    strextend (&command, "relastro -parallel-images %s", filename);
+    strextend (&command, "-region-hosts %s", REGION_FILE);
+    strextend (&command, "-region-hostID %d", host->hostID);
+    strextend (&command, "-D CATDIR %s", CATDIR);
+    strextend (&command, "-region %f %f %f %f", host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat);
+    strextend (&command, "-statmode %s", STATMODE);
+    strextend (&command, "-minerror %f", MIN_ERROR);
+    strextend (&command, "-nloop %d", NLOOP);
+    strextend (&command, "-threads %d", NTHREADS);
 
     switch (FIT_TARGET) {
       case TARGET_SIMPLE:
-	strextend (command, "-update-simple");
+	strextend (&command, "-update-simple");
 	break;
       case TARGET_CHIPS:
-	strextend (command, "-update-chips");
+	strextend (&command, "-update-chips");
 	break;
       case TARGET_MOSAICS:
-	strextend (command, "-update-mosaics");
+	strextend (&command, "-update-mosaics");
 	break;
       case TARGET_NONE:
@@ -102,54 +102,54 @@
     }
 
-    if (VERBOSE)       	    strextend (command, "-v");
-    if (VERBOSE2)      	    strextend (command, "-vv");
-    if (RESET)         	    strextend (command, "-reset");
-    if (UPDATE)        	    strextend (command, "-update");
-    if (PARALLEL)      	    strextend (command, "-parallel");
-    if (PARALLEL_MANUAL)    strextend (command, "-parallel-manual");
-    if (PARALLEL_SERIAL)    strextend (command, "-parallel-serial");
-    if (PHOTCODE_KEEP_LIST) strextend (command, "+photcode %s", PHOTCODE_KEEP_LIST); 
-    if (PHOTCODE_SKIP_LIST) strextend (command, "-photcode %s", PHOTCODE_SKIP_LIST);
-    if (PHOTCODE_RESET_LIST) strextend (command, "-reset-to-photcode %s", PHOTCODE_RESET_LIST);
+    if (VERBOSE)       	    strextend (&command, "-v");
+    if (VERBOSE2)      	    strextend (&command, "-vv");
+    if (RESET)         	    strextend (&command, "-reset");
+    if (UPDATE)        	    strextend (&command, "-update");
+    if (PARALLEL)      	    strextend (&command, "-parallel");
+    if (PARALLEL_MANUAL)    strextend (&command, "-parallel-manual");
+    if (PARALLEL_SERIAL)    strextend (&command, "-parallel-serial");
+    if (PHOTCODE_KEEP_LIST) strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST); 
+    if (PHOTCODE_SKIP_LIST) strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST);
+    if (PHOTCODE_RESET_LIST) strextend (&command, "-reset-to-photcode %s", PHOTCODE_RESET_LIST);
 
-    if (MaxDensityUse) 	    strextend (command, "-max-density %f", MaxDensityValue);
-    if (ImagSelect)         strextend (command, "-instmag %f %f", ImagMin, ImagMax);
-    if (ExcludeBogus)       strextend (command, "-exclude-bogus %f", ExcludeBogusRadius);
+    if (MaxDensityUse) 	    strextend (&command, "-max-density %f", MaxDensityValue);
+    if (ImagSelect)         strextend (&command, "-instmag %f %f", ImagMin, ImagMax);
+    if (ExcludeBogus)       strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius);
 
     if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) {
-      strextend (command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 
+      strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 
     }
     if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) {
-      strextend (command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 
+      strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 
     }
 
-    if (PhotFlagSelect)     strextend (command, "+photflags"); 
-    if (PhotFlagBad)        strextend (command, "+photflagbad %d", PhotFlagBad); 
-    if (PhotFlagPoor)       strextend (command, "+photflagpoor %d", PhotFlagPoor); 
+    if (PhotFlagSelect)     strextend (&command, "+photflags"); 
+    if (PhotFlagBad)        strextend (&command, "+photflagbad %d", PhotFlagBad); 
+    if (PhotFlagPoor)       strextend (&command, "+photflagpoor %d", PhotFlagPoor); 
 
-    if (CHIPMAP)            strextend (command, "-chipmap %d", CHIPMAP); 
-    if (RESET_IMAGES)       strextend (command, "-reset-images"); 
+    if (CHIPMAP)            strextend (&command, "-chipmap %d", CHIPMAP); 
+    if (RESET_IMAGES)       strextend (&command, "-reset-images"); 
 
-    if (MinBadQF > 0.0)        strextend (command, "-min-bad-psfqf %f", MinBadQF);
-    if (MaxMeanOffset != 10.0) strextend (command, "-max-mean-offset  %f", MaxMeanOffset);
+    if (MinBadQF > 0.0)        strextend (&command, "-min-bad-psfqf %f", MinBadQF);
+    if (MaxMeanOffset != 10.0) strextend (&command, "-max-mean-offset  %f", MaxMeanOffset);
 
-    strextend (command, "-D RELASTRO_SRC_MEAS_TOOFEW %d", SRC_MEAS_TOOFEW);
-    strextend (command, "-D RELASTRO_SIGMA_LIM %f", SIGMA_LIM);
-    strextend (command, "-D RELASTRO_DPOS_MAX %f", DPOS_MAX);
-    strextend (command, "-D ADDSTAR_RADIUS %f", ADDSTAR_RADIUS);
+    strextend (&command, "-D RELASTRO_SRC_MEAS_TOOFEW %d", SRC_MEAS_TOOFEW);
+    strextend (&command, "-D RELASTRO_SIGMA_LIM %f", SIGMA_LIM);
+    strextend (&command, "-D RELASTRO_DPOS_MAX %f", DPOS_MAX);
+    strextend (&command, "-D ADDSTAR_RADIUS %f", ADDSTAR_RADIUS);
 
-    strextend (command, "-D USE_GALAXY_MODEL %d", USE_GALAXY_MODEL);
+    strextend (&command, "-D USE_GALAXY_MODEL %d", USE_GALAXY_MODEL);
 
-    strextend (command, "-D USE_ICRF_CORRECT %d", USE_ICRF_CORRECT);
-    strextend (command, "-D USE_ICRF_LOCAL %d",   USE_ICRF_LOCAL);
-    strextend (command, "-D USE_ICRF_SHFIT %d",   USE_ICRF_SHFIT);
-    strextend (command, "-D USE_ICRF_POLE %d",    USE_ICRF_POLE);
+    strextend (&command, "-D USE_ICRF_CORRECT %d", USE_ICRF_CORRECT);
+    strextend (&command, "-D USE_ICRF_LOCAL %d",   USE_ICRF_LOCAL);
+    strextend (&command, "-D USE_ICRF_SHFIT %d",   USE_ICRF_SHFIT);
+    strextend (&command, "-D USE_ICRF_POLE %d",    USE_ICRF_POLE);
 
-    if (USE_FIXED_PIXCOORDS) strextend (command, "-D USE_FIXED_PIXCOORDS 1");
+    if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1");
 
     if (TimeSelect) { 
       char *tstart = ohana_sec_to_date (TSTART);
       char *tstop  = ohana_sec_to_date (TSTOP);
-      strextend (command, "-time %s %s", tstart, tstop); 
+      strextend (&command, "-time %s %s", tstart, tstop); 
       free (tstart);
       free (tstop);
Index: /branches/eam_branches/ohana.20150429/src/relastro/src/load_catalogs.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relastro/src/load_catalogs.c	(revision 38381)
+++ /branches/eam_branches/ohana.20150429/src/relastro/src/load_catalogs.c	(revision 38382)
@@ -160,36 +160,36 @@
     // MaxDensityUse, MaxDensityValue
 
-    char command[1024];
-    snprintf (command, 1024, "relastro_client -load-objects %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -minerror %f -D RELASTRO_SIGMA_LIM %f", 
+    char *command = NULL;
+    strextend (&command, "relastro_client -load-objects %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -minerror %f -D RELASTRO_SIGMA_LIM %f", 
 	      table->hosts[i].results, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, MIN_ERROR, SIGMA_LIM);
 
-    if (FIT_MODE == FIT_PM_ONLY)  	 strextend (command, "-pm");
-    if (FIT_MODE == FIT_PAR_ONLY) 	 strextend (command, "-par");
-    if (FIT_MODE == FIT_PM_AND_PAR)      strextend (command, "-pmpar");
-
-    if (VERBOSE)       strextend (command, "-v");
-    if (VERBOSE2)      strextend (command, "-vv");
-    if (RESET)         strextend (command, "-reset");
-    if (ImagSelect)    strextend (command, "-instmag %f %f", ImagMin, ImagMax);
-    if (MaxDensityUse) strextend (command, "-max-density %f", MaxDensityValue);
-    if (FlagOutlier)   strextend (command, "-clip %d", CLIP_THRESH);
-    if (ExcludeBogus)  strextend (command, "-exclude-bogus %f", ExcludeBogusRadius);
-
-    if (USE_ICRF_CORRECT) strextend (command, "-D USE_ICRF_CORRECT %d", USE_ICRF_CORRECT);
-    if (USE_GALAXY_MODEL) strextend (command, "-D USE_GALAXY_MODEL %d", USE_GALAXY_MODEL);
+    if (FIT_MODE == FIT_PM_ONLY)  	 strextend (&command, "-pm");
+    if (FIT_MODE == FIT_PAR_ONLY) 	 strextend (&command, "-par");
+    if (FIT_MODE == FIT_PM_AND_PAR)      strextend (&command, "-pmpar");
+
+    if (VERBOSE)       strextend (&command, "-v");
+    if (VERBOSE2)      strextend (&command, "-vv");
+    if (RESET)         strextend (&command, "-reset");
+    if (ImagSelect)    strextend (&command, "-instmag %f %f", ImagMin, ImagMax);
+    if (MaxDensityUse) strextend (&command, "-max-density %f", MaxDensityValue);
+    if (FlagOutlier)   strextend (&command, "-clip %d", CLIP_THRESH);
+    if (ExcludeBogus)  strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius);
+
+    if (USE_ICRF_CORRECT) strextend (&command, "-D USE_ICRF_CORRECT %d", USE_ICRF_CORRECT);
+    if (USE_GALAXY_MODEL) strextend (&command, "-D USE_GALAXY_MODEL %d", USE_GALAXY_MODEL);
     
     if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) {
-      strextend (command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 
+      strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 
     }
     if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) {
-      strextend (command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 
-    }
-
-    if (USE_FIXED_PIXCOORDS) strextend (command, "-D USE_FIXED_PIXCOORDS 1");
-    if (PHOTCODE_KEEP_LIST)  strextend (command, "+photcode %s", PHOTCODE_KEEP_LIST);
-    if (PHOTCODE_SKIP_LIST)  strextend (command, "-photcode %s", PHOTCODE_SKIP_LIST);
-    if (PhotFlagSelect)      strextend (command, "+photflags");
-    if (PhotFlagBad)         strextend (command, "+photflagbad %d", PhotFlagBad); 
-    if (PhotFlagPoor)        strextend (command, "+photflagpoor %d", PhotFlagPoor);
+      strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 
+    }
+
+    if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1");
+    if (PHOTCODE_KEEP_LIST)  strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST);
+    if (PHOTCODE_SKIP_LIST)  strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST);
+    if (PhotFlagSelect)      strextend (&command, "+photflags");
+    if (PhotFlagBad)         strextend (&command, "+photflagbad %d", PhotFlagBad); 
+    if (PhotFlagPoor)        strextend (&command, "+photflagpoor %d", PhotFlagPoor);
     // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
 
@@ -197,5 +197,5 @@
       char *tstart = ohana_sec_to_date (TSTART);
       char *tstop  = ohana_sec_to_date (TSTOP);
-      strextend (command, "-time %s %s", tstart, tstop); 
+      strextend (&command, "-time %s %s", tstart, tstop); 
       free (tstart);
       free (tstop);
