Fix mref indexing