Fix a large number of issues found with LuaInspect.