Modifications to allow Windows compilation