Fix build errors on windows