Fixed deprecation warning for find(:all) in search. Added test.