Exit with the correct status