Bugfix thresholding.