Cleaned up all calls to exit() outside of main() functions.