Fix a bunch of windows build errors