Applied windows build fixes from 46df635