Improved the scrolling to scroll element into view rather than just arbitrarily scrolling