fix merging of old prefs with new prefs

@TomMalbran @RaymondLim 

See inline comments