Fix using wrong iterator