Clean up behaviour of search slightly.