Fix off-by-nine bug