Merge pull request #2291 from akoeplinger/msvc-fixes