Fix bug with repetitions.