Index: trunk/psLib/src/math/psStats.c
===================================================================
--- trunk/psLib/src/math/psStats.c	(revision 36290)
+++ trunk/psLib/src/math/psStats.c	(revision 41494)
@@ -353,5 +353,6 @@
     // Sort the temporary vector.
     if (!psVectorSort(outVector, outVector)) { // Sort in-place (since it's a copy, it's OK)
-        // an error in psVectorSort is a serious error
+        // an error in psVectorSort is a serious error:
+	// NULL input vector, psVectorCopy failure, invalid vector type
         psError(PS_ERR_UNEXPECTED_NULL, false, _("Failed to sort input data."));
         stats->sampleUQ = NAN;
@@ -1888,4 +1889,5 @@
     // ************************************************************************
     if (stats->options & PS_STAT_SAMPLE_MEAN) {
+	// NOTE: vectorSampleMean cannot return 'false'
         if (!vectorSampleMean(inF32, errorsF32, maskVector, maskVal, stats)) {
             psError(PS_ERR_UNKNOWN, false, "Failed to calculate vector sample mean");
@@ -1896,4 +1898,6 @@
     // ************************************************************************
     if (stats->options & (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_QUARTILE)) {
+	// NOTE: vectorSampleMedian only returns 'false' for very bad cases:
+	// NULL input vector, psVectorCopy failure, invalid vector type (likely programming errors)
         if (!vectorSampleMedian(inF32, maskVector, maskVal, stats)) {
             psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample median");
@@ -1904,4 +1908,5 @@
     // ************************************************************************
     if (stats->options & PS_STAT_SAMPLE_STDEV) {
+	// NOTE: vectorSampleStdev cannot return 'false'
         if (!vectorSampleStdev(inF32, errorsF32, maskVector, maskVal, stats)) {
             psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample stdev");
@@ -1911,4 +1916,5 @@
 
     if (stats->options & (PS_STAT_SAMPLE_SKEWNESS | PS_STAT_SAMPLE_KURTOSIS)) {
+	// NOTE: vectorSampleMoments cannot return 'false'
         if (!vectorSampleMoments(inF32, maskVector, maskVal, stats)) {
             psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample moments");
@@ -1919,8 +1925,8 @@
     // ************************************************************************
     if (stats->options & (PS_STAT_MAX | PS_STAT_MIN)) {
-        if (vectorMinMax(inF32, maskVector, maskVal, stats) == 0) {
-            psError(PS_ERR_UNKNOWN, false, "Failed to calculate vector minimum and maximum");
-            status &= false;
-        }
+	// NOTE: vectorMinMax returns 0 if there are no valid values, 
+	// but this is not an error condition.  stats.min,max are set to NAN.
+	// vectorMinMax cannot raise an error
+        vectorMinMax(inF32, maskVector, maskVal, stats);
     }
 
