Small changes to file handler