Small fix for the autoscroll code to exactly restore the previous behaviour