Fix a memleak and update to Lua 5.2.