Swap order of nan checks to allow histogram(:middle) to work with zero stdev arrays