Fix possible IndexArrayOutOfBounds exception.
Merge pull request #31 from CampagneLaboratory/master

Fix possible IndexArrayOutOfBounds exception.