Fix overflow issues in iPhone