Fix flat interpretation hierarchy

A previous pull request caused all headers of the interpretation to appear as children of the root interpretation. This patch fixes that by building a proper tree for these interpretations.