Index: trunk/ppImage/src/ppImageLoop.c
===================================================================
--- trunk/ppImage/src/ppImageLoop.c	(revision 6079)
+++ trunk/ppImage/src/ppImageLoop.c	(revision 6114)
@@ -89,6 +89,24 @@
 
             ppDetrendCell(&detrend, options, config);
+
+            // Need to free detrend cells here so we have enough memory to do other stuff
+            psFree(detrend.bias);
+            psFree(detrend.dark);
+            psFree(detrend.mask);
+            psFree(detrend.flat);
         }
+
+        int numMosaicked = pmChipMosaic(inputChip, 1, 1); // Number of cells mosaicked together
+        psLogMsg(__func__, PS_LOG_INFO, "%d cells mosaicked.\n", numMosaicked);
+
     }
+
+    // Free the detrend FPA and chips
+    psFree(data->bias);
+    psFree(data->dark);
+    psFree(data->mask);
+    psFree(data->flat);
+
+
     return true;
 }
