Fixes to to Mingw environment