Fix an issue with popups getting stuck.