unmask AffectedRows
small code optimizations