Refs #1 fixed

Bug fix of the issue with index change on rotation.
Merge pull request #4 from miumi-u/master

Fixes #1.