Minor fixes to generate syntactically valid Lua