Fix compile errors on Windows