Sort subdocuments in arrays before comparing them

It's just a little fix that was missing from the previous pull request.