Some tree manipulations