Fix MinGW build.
Merge branch 'master' into agentzh