Fixed iterator read value before check bounds error.