Fix off-by-one