Bug fix in binarySearchForPrefix & a unit test