Small tweaks for lua 5.2 support