Fixed search bug.
Efficiency improvement.