Re-written the multi-indices support for arrays.