more changes to fix lua 5.2 compat