more fixes for Windows, but still not fully working