Improved endgame and disconnect handling.