Improve refresh of dendrogram and correct view switch bug