Fixed iterator use. Failed to convert code after the paste.