Some improvements to searching