Additions and fixes for Lua attribute accessor functions

Closes #384 and #382.