Fixed bugs in subscripts for arrays