Fix terminating the program when the script ends.