Index: trunk/psModules/src/camera/pmFPAWrite.c
===================================================================
--- trunk/psModules/src/camera/pmFPAWrite.c	(revision 15094)
+++ trunk/psModules/src/camera/pmFPAWrite.c	(revision 15096)
@@ -8,7 +8,11 @@
 #include <pslib.h>
 
+#include "pmConfig.h"
 #include "pmHDU.h"
 #include "pmFPA.h"
 #include "pmFPALevel.h"
+#include "pmFPAview.h"
+#include "pmDetrendDB.h"
+#include "pmFPAfile.h"
 #include "pmHDUUtils.h"
 #include "pmHDUGenerate.h"
@@ -65,6 +69,6 @@
         }
 
-        pmFPAview *view = pmFPAViewGenerate(fpa, chip, cell, NULL); // View for fpa, chip, cell
-        psString *content = pmFPANameFromRule(rule, fpa, view); // Content of this file, specified by the rule
+        pmFPAview *view = pmFPAviewGenerate(fpa, chip, cell, NULL); // View for fpa, chip, cell
+        psString content = pmFPANameFromRule(rule, fpa, view); // Content of this file, specified by the rule
         psFree(view);
 
@@ -76,5 +80,5 @@
         }
 
-        psMetadataAddStr(hdu->header, PS_LIST_END, contentKey, PS_META_REPLACE, "Content of file", content);
+        psMetadataAddStr(hdu->header, PS_LIST_TAIL, contentKey, PS_META_REPLACE, "Content of file", content);
         psFree(content);                // Drop reference
     }
