fixed Windows compilation bugs