Some fixes for system upgrade or sync-from-ram on reboot.