Fixed scrolling and tab switching bugs