The main function should return 1 when exiting on an error.