Fix missing counter handling in index creation.