Fix VC and OpenMP build

Original commits were rebased and force pushed