Check for end of iterator bug