Fixed bug in *PtrTrie.Purge(), replaced some repetitive code with inline functions