Added a function to correct file attributes and owner/group.