Fixed iterator usage