Minor changes to binary_search and corresponding unittest.