Fixed bug in thresholdmask.m