off-by-one error?