Preventing infinite recursion on unbound iterator