Given a sequence of untypedAtomic values, min() and
max() should return an xs:double, the result of
converting one of these values to a number. However, if
the min or max is the first one in the sequence, it is
returned unconverted, as an xdt:untypedAtomic value.
Source code fixed.