Much improved handling of "witnesses" substitution