Small fixes for Mingw/MSVC