Fix compilation errors for Lua 5.2 and below