ENG-4898 Test and fix index range wrap-around logic.