advanced search and other fixes