Fix emit-signal marshalling of references and pointers to objects.