Reduce diff with upstream.
Improve compatibility with recent flex from flex.sourceforge.net.