fix sprofile_tree for changed sortperm behaviour

* sortperm now only returns p (see #2160)
Merge pull request #6 from rened/patch-2

fix sprofile_tree for changed sortperm behaviour