Fix bug when searching through an empty dataset.