Index: trunk/ppMerge/src/ppMergeCheckInputs.c
===================================================================
--- trunk/ppMerge/src/ppMergeCheckInputs.c	(revision 13230)
+++ trunk/ppMerge/src/ppMergeCheckInputs.c	(revision 13246)
@@ -23,10 +23,13 @@
     psString outName = psMetadataLookupStr(NULL, config->arguments, "OUTPUT"); // The output file name
     assert(outName);                    // It should be there!
+    outName = pmConfigConvertFilename(outName, config, true);
     data->outFile = psFitsOpen(outName, "w"); // Output FITS file
     if (!data->outFile) {
         // There's no point in continuing if we can't open the output
         psErrorStackPrint(stderr, "Can't open output image: %s\n", outName);
+        psFree(outName);
         exit(EXIT_FAILURE);
     }
+    psFree(outName);
 
     // Statistics file
@@ -59,7 +62,8 @@
         }
         psTrace("ppMerge", 1, "Checking input file %s....\n", name);
-        psFits *inFile = psFitsOpen(filenames->data[i], "r"); // The FITS file to read
+        psString resolved = pmConfigConvertFilename(name, config, false); // Resolved file name
+        psFits *inFile = psFitsOpen(resolved, "r"); // The FITS file to read
         if (!inFile) {
-            psLogMsg(__func__, PS_LOG_WARN, "Unable to open input file %s --- ignored.\n", name);
+            psLogMsg(__func__, PS_LOG_WARN, "Unable to open input file %s --- ignored.\n", resolved);
             // Kick it out
             psFree(filenames->data[i]);
@@ -67,4 +71,5 @@
             continue;
         }
+        psFree(resolved);
         psMetadata *header = psFitsReadHeader(NULL, inFile); // The FITS (primary) header
         data->files->data[i] = inFile;
