Fix off-by-one errors printing