Fix bug when searching with empty string.