Fix infinite loop in highlighter