issue #2865: Compilation error fixes for Lua and JS bindings.