Some lua-related improvements.