Some fixes after testing on windows.2