Fix VS project and compilation errors on windows