fix off-by-one error following rebase