Final tweaks to do_backup function