Index: trunk/psModules/src/camera/pmFPAConstruct.c
===================================================================
--- trunk/psModules/src/camera/pmFPAConstruct.c	(revision 10421)
+++ trunk/psModules/src/camera/pmFPAConstruct.c	(revision 10447)
@@ -233,5 +233,5 @@
         const char *name = psMetadataLookupStr(&mdok, chip->concepts, "CHIP.NAME");
         if (mdok && name && strlen(name) > 0) {
-            contentKey = psStringSubstitute(contentKey, name, "{CHIP.NAME}");
+            psStringSubstitute(&contentKey, name, "{CHIP.NAME}");
         }
     }
@@ -245,5 +245,5 @@
         const char *name = psMetadataLookupStr(&mdok, cell->concepts, "CELL.NAME");
         if (mdok && name && strlen(name) > 0) {
-            contentKey = psStringSubstitute(contentKey, name, "{CELL.NAME}");
+            psStringSubstitute(&contentKey, name, "{CELL.NAME}");
         }
     }
Index: trunk/psModules/src/camera/pmFPAfile.c
===================================================================
--- trunk/psModules/src/camera/pmFPAfile.c	(revision 10421)
+++ trunk/psModules/src/camera/pmFPAfile.c	(revision 10447)
@@ -182,5 +182,5 @@
         char *name = psMetadataLookupStr (NULL, file->names, "OUTPUT");
         if (name != NULL) {
-            newName = psStringSubstitute (newName, name, "{OUTPUT}");
+            psStringSubstitute(&newName, name, "{OUTPUT}");
         }
     }
@@ -190,5 +190,5 @@
             char *name = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME");
             if (name != NULL) {
-                newName = psStringSubstitute (newName, name, "{CHIP.NAME}");
+                psStringSubstitute(&newName, name, "{CHIP.NAME}");
             }
         }
@@ -201,5 +201,5 @@
             psStringAppend (&name, "%02d", view->chip);
         }
-        newName = psStringSubstitute (newName, name, "{CHIP.N}");
+        psStringSubstitute(&newName, name, "{CHIP.N}");
         psFree (name);
     }
@@ -209,5 +209,5 @@
             char *name = psMetadataLookupStr (NULL, cell->concepts, "CELL.NAME");
             if (name != NULL) {
-                newName = psStringSubstitute (newName, name, "{CELL.NAME}");
+                psStringSubstitute(&newName, name, "{CELL.NAME}");
             }
         }
@@ -220,10 +220,10 @@
             psStringAppend (&name, "%02d", view->cell);
         }
-        newName = psStringSubstitute (newName, name, "{CELL.N}");
+        psStringSubstitute(&newName, name, "{CELL.N}");
     }
     if (strstr (newName, "{EXTNAME}") != NULL) {
         pmHDU *hdu = pmFPAviewThisHDU (view, file->fpa);
         if (hdu->extname && *hdu->extname) {
-            newName = psStringSubstitute (newName, hdu->extname, "{EXTNAME}");
+            psStringSubstitute(&newName, hdu->extname, "{EXTNAME}");
         }
     }
@@ -232,5 +232,5 @@
             char *name = psMetadataLookupStr (NULL, file->fpa->concepts, "FPA.FILTER");
             if (name && *name) {
-                newName = psStringSubstitute (newName, name, "{FILTER}");
+                psStringSubstitute(&newName, name, "{FILTER}");
             }
         }
@@ -242,5 +242,5 @@
             char *name = psStringCopy ("isp");
             if (name && *name) {
-                newName = psStringSubstitute (newName, name, "{CAMERA}");
+                psStringSubstitute(&newName, name, "{CAMERA}");
             }
             psFree (name);
@@ -254,5 +254,5 @@
                 char *ID = psMetadataLookupStr (NULL, filterTable, filterName);
                 if (ID && *ID) {
-                    newName = psStringSubstitute (newName, ID, "{FILTER.ID}");
+                    psStringSubstitute(&newName, ID, "{FILTER.ID}");
                 }
             }
