Fix history and scrolling