Fix accidental early termination on windows platform