Add fixes for compiling on Windows

Add in workarounds for building on Windows