Fixed an issue with RootTerm.  Because it is its own term, and we pass all terms via EPTR, we have an issue with the reference count being off.  This is fixed by explicitly managing the shared pointer inside RootTerm and providing a factory method.