fix problem with multiple ws_closed dialogs at same time during gui testing
misc gui test tweaks and PEP cleanup