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

Various fixes to sync Lua scripting with recent updates