Fix support for deserializing optional parameters

Without this change, `deserialize()` raises KeyError when some field values are missing.