Fix off-by-one error

Too much shift caused integer overflow.