Bug fixes for hierarchical