Reduce potential memory leaks of PyTermex.