Added extra NULL check at the end of HashSearch.