Fix issue with rereffing or resetting and nested each