Changed DO_NOTHING_ON_CLOSE to EXIT_ON_CLOSE so the program terminates
properly and smoothly.