BUG repeat_times fixed.