Fixing window closure clean-up for modeless dialogs.