Fixed ToLua issues