Fix crash on windows when upgrading config.