Fix type order (a reverse was missing).
XSD: complete primitive type calculation.