Index: trunk/psModules/src/camera/pmFPAConstruct.c
===================================================================
--- trunk/psModules/src/camera/pmFPAConstruct.c	(revision 15068)
+++ trunk/psModules/src/camera/pmFPAConstruct.c	(revision 15087)
@@ -701,5 +701,6 @@
                                 pmChip *chip, // Known chip to which to add, or NULL
                                 const psMetadata *format, // The camera format
-                                pmHDU *phdu // The Primary HDU
+                                pmHDU *phdu, // The Primary HDU
+                                bool install // Install the HDUs?
                                 )
 {
@@ -746,4 +747,10 @@
     }
 
+    if (!install) {
+        // Everything below is about installing the HDUs
+        psFree(chipType);
+        return true;
+    }
+
     if (!addHDUtoChip(chip, phdu)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to add HDU to chip\n");
@@ -803,5 +810,6 @@
                                 pmChip *chip, // Known chip to which to add, or NULL
                                 const psMetadata *format, // The camera format
-                                pmHDU *phdu // Primary HDU
+                                pmHDU *phdu, // Primary HDU
+                                bool install // Install the HDUs?
                                 )
 {
@@ -845,4 +853,10 @@
     }
 
+    if (!install) {
+        // Everything below is about installing the HDU
+        psFree(chipType);
+        return true;
+    }
+
     if (!addHDUtoChip(chip, phdu)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to add HDU to chip\n");
@@ -879,5 +893,6 @@
                                 pmCell *cell, // Known cell to which to add, or NULL
                                 const psMetadata *format, // The camera format
-                                pmHDU *phdu // The Primary HDU
+                                pmHDU *phdu, // The Primary HDU
+                                bool install // Install the HDUs?
                                 )
 {
@@ -1029,4 +1044,12 @@
         psFree(cellNames);
         psFree(cellTypes);
+    }
+
+    if (!install) {
+        // Everything below is about installing the HDU
+        psFree(chipNames);
+        psFree(cellNames);
+        psFree(cellTypes);
+        return true;
     }
 
@@ -1201,24 +1224,20 @@
           switch (extLevel) {
             case PM_FPA_LEVEL_CELL:
-              if (install) {
-                  phdu->blankPHU = true;
-                  if (!addSource_CHIP_CELL(view, fpa, chip, format, phdu)) {
-                      psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
-                      psFree(phdu);
-                      psFree(view);
-                      return NULL;
-                  }
+              phdu->blankPHU = true;
+              if (!addSource_CHIP_CELL(view, fpa, chip, format, phdu, install)) {
+                  psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
+                  psFree(phdu);
+                  psFree(view);
+                  return NULL;
               }
               psFree(phdu);
               return view;
             case PM_FPA_LEVEL_NONE:
-              if (install) {
-                  phdu->blankPHU = false;
-                  if (!addSource_CHIP_NONE(view, fpa, chip, format, phdu)) {
-                      psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
-                      psFree(phdu);
-                      psFree(view);
-                      return NULL;
-                  }
+              phdu->blankPHU = false;
+              if (!addSource_CHIP_NONE(view, fpa, chip, format, phdu, install)) {
+                  psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
+                  psFree(phdu);
+                  psFree(view);
+                  return NULL;
               }
               psFree(phdu);
@@ -1243,12 +1262,10 @@
               cell = chip->cells->data[phuView->cell];
           }
-          if (install) {
-              phdu->blankPHU = false;
-              if (!addSource_CELL_NONE(view, fpa, cell, format, phdu)) {
-                  psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
-                  psFree(phdu);
-                  psFree(view);
-                  return NULL;
-              }
+          phdu->blankPHU = false;
+          if (!addSource_CELL_NONE(view, fpa, cell, format, phdu, install)) {
+              psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
+              psFree(phdu);
+              psFree(view);
+              return NULL;
           }
           psFree(phdu);
