Fix error on empty list.
Fix handling of maxOccurs=unbounded.