Not sure why but lua_Integer is long. However I will change this back and do a cast where the method is used which seems better