Fixed search bug. I need much more better tests.