Fix issue where not exiting program and clean up output.