Index: trunk/ppStack/src/ppStackThread.c
===================================================================
--- trunk/ppStack/src/ppStackThread.c	(revision 26076)
+++ trunk/ppStack/src/ppStackThread.c	(revision 27004)
@@ -102,5 +102,5 @@
             (FITS)->data[INDEX] = psFitsOpen(resolved, "r");                            \
             if (!(FITS)->data[INDEX]) { \
-                psError(PS_ERR_IO, false, "Unable to open file %s", (char*)(NAMES)->data[INDEX]); \
+                psError(PPSTACK_ERR_IO, false, "Unable to open file %s", (char*)(NAMES)->data[INDEX]); \
                 psFree(resolved); \
                 return NULL; \
@@ -152,10 +152,10 @@
     psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // Recipe
     if (!recipe) {
-        psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find recipe %s", PPSTACK_RECIPE);
+        psError(PPSTACK_ERR_CONFIG, false, "Unable to find recipe %s", PPSTACK_RECIPE);
         return NULL;
     }
     int rows = psMetadataLookupS32(NULL, recipe, "ROWS"); // Number of rows to read per chunk
     if (rows <= 0) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "ROWS is not set in the recipe.");
+        psError(PPSTACK_ERR_CONFIG, false, "ROWS is not set in the recipe.");
         return NULL;
     }
@@ -204,5 +204,6 @@
                     keepReading = true;
                     if (!pmReadoutReadChunk(ro, imageFits, 0, NULL, rows, overlap, config)) {
-                        psError(PS_ERR_IO, false, "Unable to read chunk %d for file PPSTACK.INPUT %d",
+                        psError(PPSTACK_ERR_IO, false,
+                                "Unable to read chunk %d for file PPSTACK.INPUT %d",
                                 numChunk, i);
                         *status = false;
@@ -214,5 +215,6 @@
                     keepReading = true;
                     if (!pmReadoutReadChunkMask(ro, maskFits, 0, NULL, rows, overlap, config)) {
-                        psError(PS_ERR_IO, false, "Unable to read chunk %d for file PPSTACK.INPUT.MASK %d",
+                        psError(PPSTACK_ERR_IO, false,
+                                "Unable to read chunk %d for file PPSTACK.INPUT.MASK %d",
                                 numChunk, i);
                         *status = false;
@@ -224,5 +226,5 @@
                     keepReading = true;
                     if (!pmReadoutReadChunkVariance(ro, varianceFits, 0, NULL, rows, overlap, config)) {
-                        psError(PS_ERR_IO, false,
+                        psError(PPSTACK_ERR_IO, false,
                                 "Unable to read chunk %d for file PPSTACK.INPUT.VARIANCE %d",
                                 numChunk, i);
