Fixed scrollup swapping lines by making the scrolling algroithm a little less tricky.