[rmcardle] Improve SetRdGateway().