Minor cleanup to the backup function