Various MinGW compile fixes.
Merge pull request #394 from dpogue/mingw-fixes

Various MinGW compile fixes.