The Institutional Design of Riparian Treaties