Fixed handling of dicts in serialization.