Small changes to the lookup and search commands and improve its tests.