Fixed a long-standing bug where teams were being doubled-booked for matches.