Fixed window movement during viewport scrolling, minor cleanup.