small tweeks to fix tree generation