Off-by-one fix