Fix invalid type hierarchy creation by Pojo logic