I have almost resolved the casting issues in the LuaScriptingEngine, but now the unit tests for CountedPtr fail again