Prevent ArrayOutOfBounds exception on idForPosition
Merge pull request #14 from vishna/master

array out of bounds