Sort when commands are inserted/removed.