Search debugging

search bugs squashed.