Index: /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FrameCorrection.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FrameCorrection.c	(revision 37659)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FrameCorrection.c	(revision 37660)
@@ -32,5 +32,7 @@
     free (syncfile);
   }
-  return TRUE;
+
+  int status = HarvestRegionHosts (regionHosts);
+  return status;
 }
 
@@ -96,4 +98,8 @@
 
   FrameCorrectionSet *set = FrameCorrectionSetInit();
+  if (!USE_ICRF_LOCAL && !USE_ICRF_SHFIT) {
+    fprintf (stderr, "ERROR: no ICRF correction mode selected\n");
+    exit (0);
+  }
 
   if (USE_ICRF_LOCAL) {
@@ -506,5 +512,5 @@
   double Xave, Yave;
 
-  AstromOffsetMap *map = coords->offsetMap;
+  AstromOffsetMap *map = coords ? coords->offsetMap : NULL;
 
   int i, j;
@@ -517,18 +523,21 @@
       double D = average->D;
 
-      myAssert (coords, "no local frame coords defined");
-
-      // this local correction is defined for (Rmin < R < Rmax, Dmin < D < Dmax)
-      int useLocal = RD_to_XY (&Xave, &Yave, R, D, coords);
-      if (USE_ICRF_POLE) {
-	useLocal = (D > 85.0);
-      } else {
-	useLocal = (useLocal && (Xave > 0.0));
-	useLocal = (useLocal && (Xave < map->Nx));
-	useLocal = (useLocal && (Yave > 0.0));
-	useLocal = (useLocal && (Yave < map->Ny));
+      int inLocalRegion = FALSE;
+      if (USE_ICRF_LOCAL) {
+	myAssert (coords, "no local frame coords defined");
+
+	// this local correction is defined for (Rmin < R < Rmax, Dmin < D < Dmax)
+	inLocalRegion = RD_to_XY (&Xave, &Yave, R, D, coords);
+	if (USE_ICRF_POLE) {
+	  inLocalRegion = (D > 85.0);
+	} else {
+	  inLocalRegion = (inLocalRegion && (Xave > 0.0));
+	  inLocalRegion = (inLocalRegion && (Xave < map->Nx));
+	  inLocalRegion = (inLocalRegion && (Yave > 0.0));
+	  inLocalRegion = (inLocalRegion && (Yave < map->Ny));
+	}
       }
 
-      if (useLocal) {
+      if (inLocalRegion) {
 	myAssert (map, "no local frame map defined");
 	double dX = AstromOffsetMapValue (map, Xave, Yave, TRUE);
@@ -539,5 +548,8 @@
 	  XY_to_RD (&average->R, &average->D, Xmeas, Ymeas, coords);
 	}
-      } else {
+	continue;
+      }
+      
+      if (USE_ICRF_SHFIT) {
 	myAssert (frame, "no frame correction defined");
 
