Scroll past end bug

Fixed an infinite loop that occurred when you have scroll past end
enabled.