Merge pull request #537 from TTimo/master

mingw32 fixes