Fixed priority comparisons giving the wrong result.
The sorting button now gets window focus on launch.