More improvements for random tree generation