Change implementation to build with MSVC