Index: trunk/psastro/src/psastroMosaicGetRefstars.c
===================================================================
--- trunk/psastro/src/psastroMosaicGetRefstars.c	(revision 9374)
+++ trunk/psastro/src/psastroMosaicGetRefstars.c	(revision 9574)
@@ -11,6 +11,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;
     }
 
@@ -18,6 +18,6 @@
     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;
     }
 
@@ -30,9 +30,9 @@
     // this loop selects the matched stars for all chips
     while ((chip = pmFPAviewNextChip (view, 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; }
 	
 	while ((cell = pmFPAviewNextCell (view, 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; }
 
@@ -75,5 +75,5 @@
 		    psFree (ref);
 		}
-		psTrace (__func__, 4, "Added %ld refstars\n", refstars->n);
+		psTrace ("psastro", 4, "Added %ld refstars\n", refstars->n);
 		psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.REFSTARS", PS_DATA_ARRAY, "astrometry matches", refstars);
 
