Multiple changes in client code for Windows compilation (UNFINISHED)