More windows specific fixes with CWD handling