Better implementation of ToInteger for numbers near 2^32.