Fix printed string showed when file opening fails