Fix recursive getTree call