Fix infinite loop when finding opening comments