Fix computation of number of rules.