Fixes bug with serializing KeyValuePair.