Fix negative indexing issue.

As the title says, this PR fixes a small issue with indexing tuples with negative indices.