Fix overflow on iOS