Minor changes to endProgram()