Fixed the window-close issue with the new dialog code. It now works.