Fix incorrect collection counting