Merge "Fix incorrect indexing calculation." into jb-mr1-dev