Fix agent test via gateway for deserialized capability objects.