Bug fixes for LuaAPI
Additional sample Lua plugin for users.