with Lua 5.3, the type detection is not longer a hack
compat with Small Lua
don't test 2^51 when Small Lua
update type detection for Lua 5.3