Fixing issues when building on Windows