fix axis reindexing code
fix axis reindexing code

the previous version of this code was buggy because it could create a
left handed coordinate system

patmarion/director,patmarion/director,manuelli/director,manuelli/director,manuelli/director,patmarion/director,patmarion/director,patmarion/director,manuelli/director,manuelli/director