fixed unit tests for cleaning and escaping of terms.