Fixed bug in advanced search