Fix do-close on dialogs