Fixed off by one error that could cause array index out of bounds except...

...ions.