Fixing issue that caused the program to exit normally after a failure occurred