Cleaned up file processing.