fix invalid scaling when thresholds are 0