Fix an infinite loop scenario with elections.
Code now passes unit tests again.