mingw32 fixes
Merge pull request #537 from TTimo/master

mingw32 fixes