Merge "Fix stack overflow and duplicate methods while tracing."