Fix bug when parsing hierarchies in which the same value is used on
different levels