Fixed to work correctly with Lua 5.2.2.