Use lua_tonumber() instead of lua_tointeger() because of possible signed issues