Windows compilation problems fixed