Fix for python 3 indexing exceptions

Assuming the tests pass, closes: #12716