Fixes so code compiles under MSVC