Fix Python 3 incompatibilities
Remove extra whitespace
Sort results for deterministic results

despite hash randomization