Fix calculation of maxDocumentDistributionCount