Fix issue #2040

Changing the query favorties/history would cause an UI inconsitency when the list was filtered before.