Fix some build errors for Windows