Index: trunk/psastro/src/psastroDataLoad.c
===================================================================
--- trunk/psastro/src/psastroDataLoad.c	(revision 9374)
+++ trunk/psastro/src/psastroDataLoad.c	(revision 9574)
@@ -1,10 +1,8 @@
 # include "psastro.h"
-// XXX leak free 2006.04.27
-
 // this loop loads the data from the input files and selects the
 // brighter stars for astrometry
 // at the end of this function, the complete stellar data is loaded
 // into the correct fpa structure locations (readout.analysis:PSPHOT.SOURCES)
-// 
+
 // all of the different astrometry analysis modes use the same data load loop
 bool psastroDataLoad (pmConfig *config) {
@@ -17,6 +15,6 @@
     psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO");
     if (!recipe) {
-	psErrorStackPrint(stderr, "Can't find PSASTRO recipe!\n");
-	exit(EXIT_FAILURE);
+	psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n");
+	return false;
     }
 
@@ -24,7 +22,8 @@
     pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT");
     if (!input) {
-	psErrorStackPrint(stderr, "Can't find input data!\n");
-	exit(EXIT_FAILURE);
+	psError(PSASTRO_ERR_CONFIG, true, "Can't find input data!\n");
+	return false;
     }
+
     // de-activate all files except PSASTRO.INPUT
     pmFPAfileActivate (config->files, false, NULL);
@@ -37,10 +36,10 @@
 
     while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) {
-        psTrace (__func__, 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
+        psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
         if (!chip->process || !chip->file_exists) { continue; }
 	pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
 
 	while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
-            psTrace (__func__, 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
+            psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
             if (!cell->process || !cell->file_exists) { continue; }
 	    pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
