Fix viewport scrolling bug