Fix the restore database bug.