Apparatus is provided for implantation of live cells in a subject. The apparatus includes an implantable immunoisolation device, which includes (a) a chamber, which contains the live cells (b) an inner membrane layer, which is disposed at an external surface of the chamber, and which comprises a selective membrane that is permeable to nutrients and (c) an outer hydrogel layer, which comprises a hydrogel, and which is attached to and coats an outer surface of the inner membrane layer. Other embodiments are also described.