An ingestible pill is provided that includes an enteric coating and a medication-delivery device, which includes (a) a patch having upper and lower surfaces that face in generally opposite directions, and (b) needles. The patch is disposed within the enteric coating, folded so as to define one or more creases, which define respective inner and outer crease sides, wherein at least 50% of the needles are coupled to the patch along the inner crease sides. The patch is configured to assume, after the enteric coating dissolves, an expanded shape, in which the patch has an outer perimeter. Other embodiments are also described.