Handle case when pair has two gateways

Fixes #886.

![screen shot 2014-09-29 at 3 06 09 pm](https://cloud.githubusercontent.com/assets/3108007/4450395/e9737f30-4824-11e4-8cfc-73b3d00aa499.png)