Swap order of nan checks to allow histogram(:middle) to work with zero stdev arrays
Fix histogram(:middle) when length of array is 1