Added hasRoot() and getRoot()