Fix windows build

Sync .cpp files with recent changes