Fix an off-by-one range interval bug