Fix buggy handling of revisions in search.