Fix Lua errors