Merge "Use correct extension based on file contents." into sc-dev