Moved .Call to buildtree to body of R method buildtree.