Index: trunk/psLib/src/math/psStats.c
===================================================================
--- trunk/psLib/src/math/psStats.c	(revision 1326)
+++ trunk/psLib/src/math/psStats.c	(revision 1327)
@@ -1600,8 +1600,8 @@
 
     // Allocate the bins, and initialize them to zero.
-    newHist->nums =  psVectorAlloc(n, PS_TYPE_S32);
+    newHist->nums =  psVectorAlloc(n, PS_TYPE_U32);
     newHist->nums->n = newHist->nums->nalloc;
     for (i=0;i<newHist->nums->n;i++) {
-        newHist->nums->data.S32[i] = 0;
+        newHist->nums->data.U32[i] = 0;
     }
 
@@ -1656,8 +1656,8 @@
     // Allocate the bins, and initialize them to zero.  If there are N bounds,
     // then there are N-1 bins.
-    newHist->nums = psVectorAlloc((bounds->n)-1, PS_TYPE_S32);
+    newHist->nums = psVectorAlloc((bounds->n)-1, PS_TYPE_U32);
     newHist->nums->n = newHist->nums->nalloc;
     for (i=0;i<newHist->nums->n;i++) {
-        newHist->nums->data.S32[i] = 0;
+        newHist->nums->data.U32[i] = 0;
     }
 
@@ -1705,4 +1705,15 @@
     if (out == NULL) {
         return(NULL);
+    }
+
+    // Check the specified output histogram for type psF32
+    if (out->bounds->type.type != PS_TYPE_F32) {
+        psAbort(__func__,
+                "Only data type PS_TYPE_F32 for the output.bounds member.");
+    }
+
+    if (out->nums->type.type != PS_TYPE_U32) {
+        psAbort(__func__,
+                "Only data type PS_TYPE_U32 for output.nums member.");
     }
 
