Fixing tests to sort the output before comparing