More lua 5.2 compatibility. Most features now work