Fixes for scrolling past the end of content and handling window resize better