Changes ReferentialText to strip out bad elements.