Fixed hierarchical clustering bugs