Fix regressions in attach Upstream-commit: 2052d01b1e52a4b1fa79fdc73c52a7b52f6d88a7 Component: engine