Fix bug so that the program will now end.