Avoid nested iterator exception