Index: trunk/Ohana/src/dvomerge/src/Shutdown.c
===================================================================
--- trunk/Ohana/src/dvomerge/src/Shutdown.c	(revision 40572)
+++ trunk/Ohana/src/dvomerge/src/Shutdown.c	(revision 40574)
@@ -4,13 +4,10 @@
 int Shutdown (char *format, ...) {  
   va_list argp;
-  char *formatplus;
+  char formatplus[1024];
   
-  ALLOCATE (formatplus, char, strlen(format) + 2);
-  strcpy (formatplus, format);
-  strcat (formatplus, "\n");
+  snprintf (formatplus, 1024, "%s\n", format);
 
   va_start (argp, format);
   vfprintf (stderr, formatplus, argp);
-  free (formatplus);
   va_end (argp);
 
Index: trunk/Ohana/src/dvomerge/src/args.c
===================================================================
--- trunk/Ohana/src/dvomerge/src/args.c	(revision 40572)
+++ trunk/Ohana/src/dvomerge/src/args.c	(revision 40574)
@@ -112,5 +112,4 @@
     remove_argument (N, argc, argv);
     ACCEPT_MOTION = TRUE;
-    remove_argument (N, argc, argv);
   }
 
@@ -330,5 +329,4 @@
     remove_argument (N, argc, argv);
     ACCEPT_MOTION = TRUE;
-    remove_argument (N, argc, argv);
   }
 
Index: trunk/Ohana/src/dvomerge/src/merge_catalogs_old.c
===================================================================
--- trunk/Ohana/src/dvomerge/src/merge_catalogs_old.c	(revision 40572)
+++ trunk/Ohana/src/dvomerge/src/merge_catalogs_old.c	(revision 40574)
@@ -386,13 +386,13 @@
     // we can choose to accept the proper-motion and parallax from the reference tgtcat
     if (ACCEPT_MOTION) {
-      output[0].average[Nave].dR         = input[0].average[N].dR;
-      output[0].average[Nave].dD         = input[0].average[N].dD;
-      output[0].average[Nave].uR         = input[0].average[N].uR;
-      output[0].average[Nave].uD         = input[0].average[N].uD;
-      output[0].average[Nave].duR        = input[0].average[N].duR;
-      output[0].average[Nave].duD        = input[0].average[N].duD;
-      output[0].average[Nave].P          = input[0].average[N].P;
-      output[0].average[Nave].dP         = input[0].average[N].dP;
-      output[0].average[Nave].Tmean      = input[0].average[N].Tmean;
+      output[0].average[n].dR         = input[0].average[N].dR;
+      output[0].average[n].dD         = input[0].average[N].dD;
+      output[0].average[n].uR         = input[0].average[N].uR;
+      output[0].average[n].uD         = input[0].average[N].uD;
+      output[0].average[n].duR        = input[0].average[N].duR;
+      output[0].average[n].duD        = input[0].average[N].duD;
+      output[0].average[n].P          = input[0].average[N].P;
+      output[0].average[n].dP         = input[0].average[N].dP;
+      output[0].average[n].Tmean      = input[0].average[N].Tmean;
     }
 
Index: trunk/Ohana/src/libdvo/src/dbCmdlineFields.c
===================================================================
--- trunk/Ohana/src/libdvo/src/dbCmdlineFields.c	(revision 40572)
+++ trunk/Ohana/src/libdvo/src/dbCmdlineFields.c	(revision 40574)
@@ -125,5 +125,5 @@
   // get the ra,dec limits...
   if (selection->useDisplay) {
-    return (TRUE);
+    // return (TRUE);
     // XXX fix this: be more careful with the projection & limits
 
@@ -134,9 +134,21 @@
     }
     
+    double Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax));
+    Dmin = graphsky.coords.crval2 - Radius;
+    Dmax = graphsky.coords.crval2 + Radius;
+    
+    if ((Dmin <= -89) || (Dmax >= 89)) {
+      Rmin = 0;
+      Rmax = 360;
+    } else {
+      double Rmod = MAX (Radius / (cos(Dmin*RAD_DEG)), Radius / (cos(Dmax*RAD_DEG)));
+      Rmin = graphsky.coords.crval1 - Rmod;
+      Rmax = graphsky.coords.crval1 + Rmod;
+    }
     // XXX the ra and dec range depend on the projection. 
     // XXX this is wrong...
     // int status;
-    XY_to_RD (&Rmin, &Dmin, graphsky.xmin, graphsky.ymin, &graphsky.coords);
-    XY_to_RD (&Rmax, &Dmax, graphsky.xmax, graphsky.ymax, &graphsky.coords);
+    // XY_to_RD (&Rmin, &Dmin, graphsky.xmin, graphsky.ymin, &graphsky.coords);
+    // XY_to_RD (&Rmax, &Dmax, graphsky.xmax, graphsky.ymax, &graphsky.coords);
   }
 
Index: trunk/Ohana/src/opihi/cmd.data/write_vectors.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/write_vectors.c	(revision 40572)
+++ trunk/Ohana/src/opihi/cmd.data/write_vectors.c	(revision 40574)
@@ -271,6 +271,6 @@
     gprint (GP_ERR, "      J : 4 byte int\n");    
     gprint (GP_ERR, "      K : 8 byte int\n");    
-    gprint (GP_ERR, "      D : 4 byte float\n");    
-    gprint (GP_ERR, "      E : 8 byte float\n");    
+    gprint (GP_ERR, "      E : 4 byte float\n");    
+    gprint (GP_ERR, "      D : 8 byte float\n");    
     gprint (GP_ERR, "   -h : this help listing\n");
     gprint (GP_ERR, "   --h : this help listing\n");
Index: trunk/Ohana/src/opihi/dvo/avextract.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/avextract.c	(revision 40572)
+++ trunk/Ohana/src/opihi/dvo/avextract.c	(revision 40574)
@@ -137,4 +137,12 @@
   // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results
   if (PARALLEL && !HOST_ID) {
+
+    if (!SetSkyRegions (selection)) {
+      FreeSkyRegionSelection (selection);
+      dbFreeFields (fields, Nfields);
+      dvo_catalog_free (&catalog);
+      goto help;
+    }
+
     int status = HostTableParallelOps (skylist, argc, argv, RESULT_FILE, TRUE, 0, VERBOSE);
 
Index: trunk/Ohana/src/opihi/dvo/avperiodogram.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/avperiodogram.c	(revision 40572)
+++ trunk/Ohana/src/opihi/dvo/avperiodogram.c	(revision 40574)
@@ -51,4 +51,12 @@
   // the result files are left behind for the user to access (no automatic re-merge)
   if (PARALLEL && !HOST_ID) {
+
+    // check for -region and apply to current sky region
+    if (!SetSkyRegions (selection)) {
+      FreeSkyRegionSelection (selection);
+      dbFreeFields (fields, Nfields);
+      goto help;
+    }
+
     int status = HostTableParallelOps (skylist, argc, argv, NULL, FALSE, 0, VERBOSE);
     SkyListFree (skylist);
Index: trunk/Ohana/src/opihi/dvo/mextract.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/mextract.c	(revision 40572)
+++ trunk/Ohana/src/opihi/dvo/mextract.c	(revision 40574)
@@ -143,4 +143,12 @@
   // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results
   if (PARALLEL && !HOST_ID) {
+
+    // check for -region and apply to current sky region
+    if (!SetSkyRegions (selection)) {
+      FreeSkyRegionSelection (selection);
+      dbFreeFields (fields, Nfields);
+      dvo_catalog_free (&catalog);
+      goto help;
+    }
 
     // Image Metadata for remote queries:
Index: trunk/Ohana/src/opihi/lib.shell/parse.c
===================================================================
--- trunk/Ohana/src/opihi/lib.shell/parse.c	(revision 40572)
+++ trunk/Ohana/src/opihi/lib.shell/parse.c	(revision 40574)
@@ -291,4 +291,5 @@
     val = dvomath (1, &L, &size, -1);
     if (val == NULL) {
+      gprint (GP_ERR, "cannot evaluate expression in brackets: %s\n", L);
       print_error ();
       goto error;
