Fixed bug in main on windows