Fix off-by-one for IPbK mode