Fix for PassDialog not closing on cancel.  Code cleanup.