Fix generator bug on windows platforms