Fixed script for calculating aggregated votings.