Fixed popups going off the page.