add a test case for things which exit the program. Fix the bug this found