Index: trunk/psLib/src/math/psStats.c
===================================================================
--- trunk/psLib/src/math/psStats.c	(revision 889)
+++ trunk/psLib/src/math/psStats.c	(revision 893)
@@ -89,4 +89,10 @@
     }
 
+    // GUS: Verify that this is the correct action.
+    if (lower > upper) {
+        //        psAbort(__func__, "psHistogram requested with lower>upper");
+        return(NULL);
+    }
+
     newHist = (psHistogram *) psAlloc(sizeof(psHistogram));
     newHist->bounds = psVectorAlloc(n+1, PS_TYPE_F32);
@@ -115,4 +121,10 @@
     psHistogram *newHist = NULL;
     int i;
+
+    // GUS: Verify that this is the correct action.
+    if (bounds == NULL) {
+        //        psAbort(__func__, "psHistogram requested with NULL bounds");
+        return(NULL);
+    }
 
     newHist = (psHistogram *) psAlloc(sizeof(psHistogram));
@@ -166,4 +178,16 @@
     int binNum = 0;
     int numBins = 0;
+
+    // GUS: Verify that this is the correct action.
+    if (out == NULL) {
+        //        psAbort(__func__, "psHistogram requested with NULL struct");
+        return(NULL);
+    }
+
+    // GUS: Verify that this is the correct action.
+    if (in == NULL) {
+        //        psAbort(__func__, "psHistogram requested with NULL struct");
+        return(out);
+    }
 
     numBins = out->nums->n;
@@ -1051,5 +1075,8 @@
 {
     if (in == NULL) {
-        psAbort(__func__, "Input data vector (in) was NULL.");
+        return(stats);
+    }
+    if (stats == NULL) {
+        return(NULL);
     }
 
