fixes and tests for mask array, index array, simple indexing