Minor fixes

- Sort comboboxes
- More compact _is_permutation implementation