Improve compatibility with old flex and fix build with GCC.