Added parameter validation to threshold and unit calculators