Changes to make things compile on MSVC