Fixed hierarchy output for some datasets