fix sprofile_tree for changed sortperm behaviour

* sortperm now only returns p (see #2160)