Fixed data-original-index generation. Closes #819