Fixed issue where modals were not hiding properly.