Fixes for Lua 5.2