fixed bug in fopen affecting Windows