Fixed problems that made tests fail when browserwindow had a different size