Fixed some calculations in KTCompareCandidates.