Fix bug in Locally Adaptive Thresholding