Fix caching
Minor refactoring in "searchmodule.c"