Added input validation to core.Number.