Fix the main function to compile on windows