Fixed and improved pdoTools::buildTree()