Crashes at these two lines if there is a limit on the number of lines to be displayed.

The index seemed to go out of bounds.