Fixed iterator check bug