fixes to search algo
Merge origin/InDev into InDev