Fix typo in function scope
fix test for windows