Exit with the proper code.