fix failing tests; and add new tests for search