Fix MSVC build

Fixes #1903