Modified output to be more specific on why the program stopped.