Add array support and improve Lua output