Minor bug fix in binary search NA/NaN

Fixed a case where 'i' has NaN to search for from 'x' with both 'NA' and 'NaN'. Added test.