Cleanup crash fixes for search overflow code