Better fix for inconsistency between attributes of layer and of features in memory layer
Avoid key error saving memory layer which is being edited (but note does not save correct unedited state)