Some fixes after testing on windows.4