Changes and fixes for auto-exit