Minor bug in scrolling code