Resolve bad cast to CJS_EventHandler