Index: /branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/RegionHostTable.c
===================================================================
--- /branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/RegionHostTable.c	(revision 36529)
+++ /branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/RegionHostTable.c	(revision 36530)
@@ -124,7 +124,7 @@
     
     table->Rmin = MIN(Rmin, table->Rmin);
-    table->Rmax = MIN(Rmax, table->Rmax);
+    table->Rmax = MAX(Rmax, table->Rmax);
     table->Dmin = MIN(Dmin, table->Dmin);
-    table->Dmax = MIN(Dmax, table->Dmax);
+    table->Dmax = MAX(Dmax, table->Dmax);
 
     // InitIOBuffer (&hosts[Nhosts].stdout, 1000);
Index: /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/args.c
===================================================================
--- /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/args.c	(revision 36529)
+++ /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/args.c	(revision 36530)
@@ -381,9 +381,21 @@
   }
 
-  if ((mode == UPDATE_AVERAGES) && (argc != 1)) relphot_usage ();
-  if (mode == UPDATE_IMAGES) {
-    PhotcodeList = strcreate (argv[1]);
-    photcodes = ParsePhotcodeList (PhotcodeList, &Nphotcodes, TRUE); // require SEC photcodes
-    remove_argument (1, &argc, argv);
+  switch (mode) {
+    case UPDATE_AVERAGES:
+      if (argc != 1) relphot_usage();
+      break;
+      
+    case UPDATE_IMAGES:
+    case PARALLEL_IMAGES:
+    case PARALLEL_REGIONS:
+      PhotcodeList = strcreate (argv[1]);
+      photcodes = ParsePhotcodeList (PhotcodeList, &Nphotcodes, TRUE); // require SEC photcodes
+      remove_argument (1, &argc, argv);
+      break;
+
+    default:
+      fprintf (stderr, "no valid mode selected\n");
+      relphot_usage();
+      break;
   }
   if (argc != 1) relphot_usage ();
Index: /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/assign_images.c
===================================================================
--- /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/assign_images.c	(revision 36529)
+++ /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/assign_images.c	(revision 36530)
@@ -65,5 +65,5 @@
     
     // this adds 1.3 sec for 3M images
-    if (!FindMosaicForImage (image, Nimage, i)) {
+    if (!FindMosaicForImage (image, Nimage, j)) {
       if (VERBOSE2) fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);
       continue;
@@ -86,4 +86,5 @@
 
     i = find_host_for_coords (regionHosts, Rc, Dc);
+
     if (i == -1) continue;
 
@@ -100,4 +101,5 @@
     }
   }
+
   return TRUE;
 }
Index: /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/launch_region_hosts.c
===================================================================
--- /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/launch_region_hosts.c	(revision 36529)
+++ /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/launch_region_hosts.c	(revision 36530)
@@ -27,5 +27,5 @@
     // subset images per host : CATDIR/Image.HOSTNAME.fits
     char filename[1024];
-    snprintf (filename, 1024, "%s/Image.%s.fits", CATDIR, host->hostname);
+    snprintf (filename, 1024, "%s/Image.%d.fits", CATDIR, host->hostID);
 
     // write the image subset for this host
@@ -33,6 +33,6 @@
 
     char command[1024];
-    snprintf (command, 1024, "relphot -parallel-images %s -region-hosts %s -region-hostID %d -D CATDIR %s -region %f %f %f %f -statmode %s -D CAMERA %s -D STAR_TOOFEW %d -minerror %f", 
-	      filename, REGION_FILE, host->hostID, CATDIR, host->Rmin, host->Rmax, host->Dmin, host->Dmax, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR);
+    snprintf (command, 1024, "relphot %s -parallel-images %s -region-hosts %s -region-hostID %d -D CATDIR %s -region %f %f %f %f -statmode %s -D CAMERA %s -D STAR_TOOFEW %d -minerror %f", 
+	      PhotcodeList, filename, REGION_FILE, host->hostID, CATDIR, host->Rmin, host->Rmax, host->Dmin, host->Dmax, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR);
 
     if (VERBOSE)       strextend (command, "-v");
