Correct infinite loop in base parser