Fix XS build on Windows #1433 #1681