Fix errors in key normalization