Fix infinite recursion in ScaledNumber::toInt.