Use empty private dictionaries instead of removing them.

Possible fix for #2846