Minor fixes in the scrolling logic.
Merge pull request #40 from aalexandrov/master

Minor fixes in the scrolling logic.