Fix next/prev link in QueryResult when query string is empty.