Windows compilation errors fixed