Updated for Lua API changes.