Improve lua 5.2 support