Add invariants to selection sorter.