Fixed some lua 5.2 incompatibilities