Merge PR #4433, fixes compilation errors for windows.

Merge PR #4433