Apparatus is provided that includes a swallowable medical treatment device, which is configured to initially assume a contracted state having a volume of less than 4 cm3. The device includes a gastric anchor, which initially assumes a contracted size, and which is configured to, upon coming in contact with a liquid, expand sufficiently to prevent passage of the anchor through a round opening having a diameter of between 1 cm and 3 cm. The device also includes a duodenal unit, which is configured to pass through the opening, and which is coupled to the gastric anchor such that the duodenal unit is held between 1 cm and 20 cm from the gastric anchor. Other embodiments are also described.