4xm: fix invalid array indexing