import/export afg, fix shape manager