Fix iterator implementation