Fix a bug with scrolling elements