Fix restore logic, delete backup files.