Clean up and add exits.