Adding code to ProxyElement to have it remember the gateway it is directed to prior to being assigned an element to wrap. Once an element to wrap gets assigned, the gateway that was set on the proxy before, gets set as the wrapped element's gateway too.