Make sure it exits cleanly