Some more fixes to enable the restore scenario.