Corrected logic errors in voting mechanism.