Correct random tree generation