Program now terminates correctly