Minor fixes in the scrolling logic.