Fix nullability of Count aggr.
Fix bug in sort