Exit gracefully; some other changes