Fix calculations related to > and counting.