Fix handling of multiple "--remote" gateways and optional [port] [proto] parameters