Fixed test search function