Fix off-by-one error introduced in previous commit