Update rmi logic for canonical references Upstream-commit: 1475557341b94ef8d8b2ced1bc4fa49b184cd5ff Component: engine