Use side-effect free sorting

Fixes test failures because sorting messed up the option-vars checker
properties.