Fixing an invalid array reference check.