Fix messages from objects with named types