Fix bugs in the voting system