fix position of indices
Merge pull request #46 from wjchen/master