Fix remaining features in the new scanner.

Adopt some minor changes to the extension module due to the new parser.