Windows compilation fixes