Possible fix for X button close issue in preferences dialog.