Index: branches/eam_branches/ohana.20170822/src/relphot/include/relphot.h
===================================================================
--- branches/eam_branches/ohana.20170822/src/relphot/include/relphot.h	(revision 40258)
+++ branches/eam_branches/ohana.20170822/src/relphot/include/relphot.h	(revision 40259)
@@ -407,4 +407,5 @@
 int           findMosaics         PROTO((Catalog *catalog, int Ncatalog, int doMosaicList));
 
+void clearImages (void);
 void checkImages (char *name);
 int dumpMags (FILE *fout, Catalog *catalog, int Ncatalog);
Index: branches/eam_branches/ohana.20170822/src/relphot/src/ImageOps.c
===================================================================
--- branches/eam_branches/ohana.20170822/src/relphot/src/ImageOps.c	(revision 40258)
+++ branches/eam_branches/ohana.20170822/src/relphot/src/ImageOps.c	(revision 40259)
@@ -1161,8 +1161,18 @@
 }
 
+void clearImages (void) {
+  image = NULL;
+}
+
 void checkImages (char *name) {
 
   off_t i;
   fprintf (stderr, "--- %s ---\n", name);
+  
+  OhanaMemblock *ref = (OhanaMemblock *) image - 1;
+  fprintf (stderr, "file: %s\n", ref->file);
+
+  fprintf (stderr, "0x%08llx \n", (unsigned long long) image);
+
   for (i = 0; i < Nimage; i++) {
     fprintf (stderr, "%s : 0x%08x : %6.3f  %6.3f\n", image[i].name, image[i].flags, image[i].McalPSF, image[i].McalAPER);
Index: branches/eam_branches/ohana.20170822/src/relphot/src/relphot_images.c
===================================================================
--- branches/eam_branches/ohana.20170822/src/relphot/src/relphot_images.c	(revision 40258)
+++ branches/eam_branches/ohana.20170822/src/relphot/src/relphot_images.c	(revision 40259)
@@ -228,4 +228,6 @@
 	// ensure the db format is updated
 	dbX.format = dvo_catalog_catformat (UPDATE_CATFORMAT);
+	gfits_modify (&dbX.header, "FORMAT", "%s", 1, UPDATE_CATFORMAT);
+
 	char photcodeFile[1024];
 	sprintf (photcodeFile, "%s/Photcodes.dat", CATDIR);
@@ -272,4 +274,5 @@
     // ensure the db format is updated
     db.format = dvo_catalog_catformat (UPDATE_CATFORMAT);
+    gfits_modify (&db.header, "FORMAT", "%s", 1, UPDATE_CATFORMAT);
   }
   if (CALIBRATE_STACKS_AND_WARPS || (NLOOP > 0)) {
Index: branches/eam_branches/ohana.20170822/src/relphot/src/relphot_parallel_images.c
===================================================================
--- branches/eam_branches/ohana.20170822/src/relphot/src/relphot_parallel_images.c	(revision 40258)
+++ branches/eam_branches/ohana.20170822/src/relphot/src/relphot_parallel_images.c	(revision 40259)
@@ -170,4 +170,5 @@
   freeGridBins (Ncatalog);
   freeImages((char *)image);
+  free (image);
 
   SkyListFree(skylist);
Index: branches/eam_branches/ohana.20170822/src/relphot/src/relphot_parallel_regions.c
===================================================================
--- branches/eam_branches/ohana.20170822/src/relphot/src/relphot_parallel_regions.c	(revision 40258)
+++ branches/eam_branches/ohana.20170822/src/relphot/src/relphot_parallel_regions.c	(revision 40259)
@@ -84,5 +84,9 @@
 
   // save the changes to the image parameters
-  dvo_image_save (&db, VERBOSE); // this function modifies the db.ftable.buffer: do not free stored Image table
+  dvo_image_save (&db, VERBOSE);
+
+  // dvo_image_save frees db.ftable.buffer (== image) and replaces it: do not free stored Image table
+  clearImages ();
+
   dvo_image_unlock (&db); 
   MARKTIME ("finished relphot -parallel-regions: %f sec total\n", dtime);
