Common JS API: fix for object instances returned via callback