Fixed bad file open