Fix bugs in vote algorithm.
Fix bugs in vote algorithm.

atomix/atomix,kuujo/copycat,quantiply-fork/copycat,kuujo/copycat,aruanruan/copycat,arnonmoscona/copycat,aruanruan/copycat,madjam/copycat,atomix/atomix,madjam/copycat,tempbottle/copycat,tempbottle/copycat,arnonmoscona/copycat