Remove a lot of code in favor of a new function that is freeing the old string and copying the new one. I should have gotten the context and the strings right.