Apparatus is provided for application to a nerve of a subject, the apparatus comprising an electrode device, which comprises a housing, which is configured to be placed at least partially around the nerve, so as to define an outer surface of the electrode device and an inner surface that faces the nerve. The electrode device further comprises one or more first electrode contact surfaces, fixed to the inner surface of the housing, and one or more second electrode contact surfaces, fixed to the outer surface of the housing. Other embodiments are also described.