Fix error in multiple affecteds indexing