Various fixes to sync Lua scripting with recent updates
Merge pull request #190 from dwimsey/feature/lua-scripting

Various fixes to sync Lua scripting with recent updates