Merge branch 'avoid-rekey-loss'