Fixed problem where (a) the search wasn't working on all pages and (b) the search was still removing flags (#open, etc...) when they were unsuccessfully applied