Fixed namespace definition issue

The CategoryTree code based is designed to strip out name spaces.
However if the namespace was not correctly defined in the first place
through the creation of custom namespaces, then the code that removes
the namespace from the navigation display did not work as expected.