fixed iterator bug

I accessed the object via it's data member instead of using a reference. It's clearer and probably easier to read. I had to change this as I was using a reference in a range-based-for.