Fixes for MSVC being brain-dead