Fixed depth bug for type hierarchy in parser