Changes required to build with Lua52