ENH: Better handling of bad thresholding