Tests on Windows and bug corrections