Add part of h0ru5's MSVC fix.