Corrected replace behaviour in TerminologyManager