fixed two memory-leak regressions introduced by recent changes to tree code
Merge branch 'master' into npRmpi