Fix python 3 indexing exceptions

Closes #12948