Fixed plot.getTree in plotting function