Fixing Windows compilation errors. There are still some warnings.