some fixes for a pure mingw32 environment