Added tiebreaker and fixed a couple bugs.