Fixes an index out of range error

"Fixes" an index out of range error of unknown cause.