Fix some problems on Windows (msvc).