Fixed Off-by-one error.