[fix] expect error objects but extract them into regular objects so they can be properly serialized
[fix] bad function references