Fix majority calculation.

Closes #143.