Index: /trunk/Ohana/src/gastro2/src/gastro2.c
===================================================================
--- /trunk/Ohana/src/gastro2/src/gastro2.c	(revision 8698)
+++ /trunk/Ohana/src/gastro2/src/gastro2.c	(revision 8699)
@@ -19,4 +19,8 @@
     gfit (&Target, &Ref, 1);
     fprintf (stderr, "precision: %f\n", Target.answer.dR / sqrt(Target.answer.N));
+    if ((Target.answer.N < 2) || isnan(Target.answer.dR)) {
+	fprintf (stderr, "ERROR: bad fit\n");
+	exit (1);
+    }
     if (VERBOSE) {
       fprintf (stderr, "%s\n", Target.coords.ctype);
@@ -33,4 +37,8 @@
     gfit (&Target, &Ref, MIN (MAX (1, NPOLYTERMS), 3));
     fprintf (stderr, "precision: %f\n", Target.answer.dR / sqrt(Target.answer.N));
+    if ((Target.answer.N < 2) || isnan(Target.answer.dR)) {
+	fprintf (stderr, "ERROR: bad fit\n");
+	exit (1);
+    }
   }
 
