Fixed end of game bug and closed chat socket on exit.