Fixed smooth scrolling function.