More indexOutOfBounds prevention