Some fixes to hierarchical data adding