Array bounds overflow fix

Doesn't have to be a var as far as I can see.