Fix build and warnings on Windows.