Fix error when counting repositories