Fix indices to be monotonically increasing