Try exiting cleanly after error