For ENG-5256, fix issues in various binary searches, make hash ranges inclusive at both ends, fix some test issues