Fixing scope bug on Windows