Added some tree utility functions.