Fixed bug where closing a dialog with an opened listbox would cause errors if new dialogs where opened.