Remove off-by-one error