Add workarounds for msvc