Index: trunk/ppMerge/src/ppMergeBackground.c
===================================================================
--- trunk/ppMerge/src/ppMergeBackground.c	(revision 7061)
+++ trunk/ppMerge/src/ppMergeBackground.c	(revision 7064)
@@ -34,6 +34,6 @@
 
 // Get the scale and zero for each chip of each input
-bool ppMergeScaleZero(ppImage **scales, // The scales for each integration/cell
-                      ppImage **zeros, // The zeroes for each integration/cell
+bool ppMergeScaleZero(psImage **scales, // The scales for each integration/cell
+                      psImage **zeros, // The zeroes for each integration/cell
                       ppMergeData *data,// The data
                       const ppMergeOptions *options, // The options
@@ -76,10 +76,10 @@
         psFits *inFile = psFitsOpen(filenames->data[i], "r"); // The FITS file to read
         if (!inFile) {
-            psErrorPrint(PS_ERR_IO, false, "Unable to open input file %s --- ignored.\n", name);
+            psLogMsg(__func__, PS_LOG_WARN, "Unable to open input file %s --- ignored.\n", name);
             status = false;
             continue;
         }
 
-        pmFPA *fpa = in->data[i];       // The FPA for this input
+        pmFPA *fpa = data->in->data[i]; // The FPA for this input
         int cellNum = -1;               // Number of the cell
         psArray *chips = fpa->chips;    // Array of chips
@@ -106,5 +106,6 @@
                 if (options->exptime) {
                     bool mdok = true;   // Status of MD lookup
-                    exptime->data.F64[i][cellNum] = psMetadataLookup(&mdok, cell->concepts, "CELL.EXPOSURE");
+                    exptime->data.F64[i][cellNum] = psMetadataLookupF32(&mdok, cell->concepts,
+                                                                        "CELL.EXPOSURE");
                     if (!mdok || isnan(exptime->data.F64[i][cellNum])) {
                         psLogMsg(__func__, PS_LOG_WARN, "CELL.EXPOSURE for file %s chip %d cell %d is not "
@@ -139,9 +140,9 @@
                     if (options->scale) {
                         bool mdok = true;   // Status of MD lookup
-                        gain->data.F32[cellNum] = psMetadataLookupF32(&mdok, cell->concepts, "CELL.GAIN");
-                        if (!mdok || isnan(gain->data.F32[cellNum])) {
+                        gains->data.F32[cellNum] = psMetadataLookupF32(&mdok, cell->concepts, "CELL.GAIN");
+                        if (!mdok || isnan(gains->data.F32[cellNum])) {
                             psLogMsg(__func__, PS_LOG_WARN, "CELL.GAIN for file %s chip %d cell %d is not "
                                      "set.\n", name, j, k);
-                            gain->data.F32[cellNum] = NAN;
+                            gains->data.F32[cellNum] = NAN;
                             status = false;
                         }
@@ -150,12 +151,12 @@
                     // Get the background
                     psImageStats(bgStats, image, readout->mask, options->maskVal);
-                    background[i][cellNum] = getStat(bgStats, options->background);
-                }
-
-                psCellFreeData(cell);
+                    background->data.F64[i][cellNum] = getStat(bgStats, options->background);
+                }
+
+                pmCellFreeData(cell);
             }
-            psChipFreeData(chip);
-        }
-        psFPAFreeData(fpa);
+            pmChipFreeData(chip);
+        }
+        pmFPAFreeData(fpa);
         psFitsClose(inFile);
     }
