fix repeat-operation regression

- also added test to 'test' branch