Fix error when counting agg commits