Exit dialog, bug fixes