fixing type duplication during type hierarchy creation