Some fixes after testing on windows.3