Fixed incorrect instance shuffling algorithm.
Merge pull request #41 from hpxro7/bug/shuffle

Fixed incorrect instance shuffling algorithm.