lua_error() calls will be replaced by C++ exceptions to avoid memleaks.