Fixing ArrayIndexOutOfBoundsException.
Merge pull request #5 from arriolac/master

Fixing ArrayIndexOutOfBoundsException.