Remove console logging statements, fix flag aggregation.