Fix overflow error for large input values.