Fixed issue with repetition operator

Specifically, infinite looping