Save after all actions, improved exit handling