Fix error handling in util.number.toText