Don't use resource save() so Magento events are thrown. Eg processing of stock data. Also fix type to type_id
Fix Tests