Fix problem with scroll calculation.