Index: /trunk/psastro/src/psastro.c
===================================================================
--- /trunk/psastro/src/psastro.c	(revision 11268)
+++ /trunk/psastro/src/psastro.c	(revision 11269)
@@ -54,4 +54,10 @@
 
     bool chipastro = psMetadataLookupBool (NULL, config->arguments, "PSASTRO.CHIP.MODE");
+    bool mosastro  = psMetadataLookupBool (NULL, config->arguments, "PSASTRO.MOSAIC.MODE");
+    if (!chipastro && !mosastro) {
+	psLogMsg ("psastro", 3, "no astrometry mode selected, assuming chip mode\n");
+	chipastro= true;
+    }
+
     if (chipastro) {
 	if (!psastroChipAstrom (config, refs)) {
@@ -61,5 +67,4 @@
     }
 
-    bool mosastro = psMetadataLookupBool (NULL, config->arguments, "PSASTRO.MOSAIC.MODE");
     if (mosastro) {
 	if (!psastroMosaicAstrom (config, refs)) {
Index: /trunk/psastro/src/psastroDataSave.c
===================================================================
--- /trunk/psastro/src/psastroDataSave.c	(revision 11268)
+++ /trunk/psastro/src/psastroDataSave.c	(revision 11269)
@@ -19,5 +19,5 @@
     pmFPAfile *output = psMetadataLookupPtr (NULL, config->files, "PSASTRO.OUTPUT");
     if (!output) {
-	psError(PSASTRO_ERR_CONFIG, true, "Can't find output data!\n");
+	psError(PSASTRO_ERR_CONFIG, true, "Can't find or interpret output file rule PSASTRO.OUTPUT!\n");
 	return false;
     }
Index: /trunk/psastro/src/psastroErrorCodes.dat
===================================================================
--- /trunk/psastro/src/psastroErrorCodes.dat	(revision 11268)
+++ /trunk/psastro/src/psastroErrorCodes.dat	(revision 11269)
@@ -2,5 +2,5 @@
 # This file is used to generate pmErrorClasses.h
 #
-BASE = 600		First value we use; lower values belong to psLib
+BASE = 300		First value we use; lower values belong to psLib
 UNKNOWN			Unknown PM error code
 NOT_IMPLEMENTED		Desired feature is not yet implemented
Index: /trunk/psastro/src/psastroLuminosityFunction.c
===================================================================
--- /trunk/psastro/src/psastroLuminosityFunction.c	(revision 11268)
+++ /trunk/psastro/src/psastroLuminosityFunction.c	(revision 11269)
@@ -49,5 +49,8 @@
   for (int i = 0; i < stars->n; i++) {
     star = stars->data[i];
+    if (!isfinite(star->Mag)) continue;
     int bin = (star->Mag - mMin) / dMag;
+    if (bin < 0) psAbort ("psastro", "bin cannot be negative!");
+    if (bin >= nBin) psAbort ("psastro", "bin cannot be > %d!", nBin);
     nMags->data.F32[bin] += 1.0;
   }
