Additions and fixes for Lua attribute accessor functions

Closes #384 and closes #382.