fix program to generate exit code useful for testing