Bug fix for tensor::replace_contr_index().