Fixes bug in scroll detection.