Fix toNumber() and fromNumber()