fix bug in tree instance, add `n` param to driver