Try all the gateways, and a little more cleanup