fixed an off-by-one error in repetition features