Fix array out of bonds ICE