The program needs to call exit(0) to exit properly