Made exiting work better in IDLE