Fix windows-related code