deal with mixed nested index directions.
Merge branch 'master' into vec4-stack