Don't use OID's for tables
Change some more BAG id's to varchar