aligned with lua 5.2.2