Fix gcc-4.8.x warnings.
Fix some Mingw failures.
Fixes #8855.