Windows platform fixes

Fixes the following Windows platform issues:
https://issues.apache.org/jira/browse/CB-7688
https://issues.apache.org/jira/browse/CB-7692
https://issues.apache.org/jira/browse/CB-7695
https://issues.apache.org/jira/browse/CB-7690
https://issues.apache.org/jira/browse/CB-7697
https://issues.apache.org/jira/browse/CB-7784