Places fix score and quality with autocomplete integration test

You can use our sort_and_truncate function here, maybe we can put it in utils (in function.h without static).