bug fixes in determining voting ranking