Fix dereferencing of iterators