Fixed scrolling with keyboard selection

Fixes issue #501.