*8674* Fix off-by-one math