Fix bug in hierarchy causing views to be duplicated