Added support for gateways in routes_message