fixing missing increment of index in unfold3, unfold21, unfold12