semantic: Give replaceTraits a correct lookup scope, for variables.