Fixed a bug.

An if statement had the wrong bound checking for an array element
access.