Stop scrolling when top or bottom is reached

Fixes #5.