Main fixes to windows version