Cardinality analysis and other small fixes