Some modifications to make it build on Windows