Fixed some issues with election.