Fixed file open bug on windows