Added ability to override minCardinality and maxCardinality.