Fixed binary_search bug