Fixed checking validity of ->file