fix cb-3040 - Length is 1-based, index is 0 based