Fix array out of bounds segfault
Merge pull request #123 from jspricke/array_index_fix

Fix array out of bounds segfault