Lexer changes

Mostly minor things that rebasing is becoming painful.
Fixme #12938.