Fixed sorting the documents with scores