Playerlayout program now terminates properly