Add missing +1 in bounds check.