Fixed bug in advanced search introduced after last commit