min/max cardinality checks
minors
Merge branch 'coverity_scan'
try with resources
close resource
minors