A membrane cell stack arrangement, comprising: a housing having a central axis and an inner surface, a stack of membrane cells, each membrane cell being arranged inside the housing with a major surface of the membrane cell oriented substantially perpendicular to the central axis, each membrane cell having a shape with at least four sides (10a, 10b, 10c, 10d), wherein at least one of the sides of the at least four sides (10a, 10b, 10c, 10d) provide a flow input to the membrane cell and at least one of the sides of the at least four sides (10a, 10b, 10c, 10d) provide a flow output from the membrane cell and the other sides of the at least four sides (10a, 10b, 10c, 10d) provide closed side walls of the membrane cell, wherein each membrane cell comprises a corner recess between each two adjacent sides of the at least four sides (10a, 10b, 10c, 10d), wherein the corner recesses are inwardly curved, or wherein each membrane cell has four straight sides and between each two adjacent sides of the four straight sides is a corner recess having two perpendicular oriented sides, and the membrane stack arrangement further comprises sealing compartments which are substantially parallel to the central axis of the housing, each sealing compartment being provided by a corner recess of adjacent membrane cells of the stack of membrane cells in co-operation with a part of the inner surface of the housing; and the stack arrangement further comprises a sealing material to affix the stack of membrane cells to the housing and at least 50% of the sealing material used to affix the stack of membrane cells to the housing is located within the sealing compartments. a housing having a central axis and an inner surface, a stack of membrane cells, each membrane cell being arranged inside the housing with a major surface of the membrane cell oriented substantially perpendicular to the central axis, each membrane cell having a shape with at least four sides (10a, 10b, 10c, 10d), wherein at least one of the sides of the at least four sides (10a, 10b, 10c, 10d) provide a flow input to the membrane cell and at least one of the sides of the at least four sides (10a, 10b, 10c, 10d) provide a flow output from the membrane cell and the other sides of the at least four sides (10a, 10b, 10c, 10d) provide closed side walls of the membrane cell, wherein each membrane cell comprises a corner recess between each two adjacent sides of the at least four sides (10a, 10b, 10c, 10d), wherein the corner recesses are inwardly curved, or wherein each membrane cell has four straight sides and between each two adjacent sides of the four straight sides is a corner recess having two perpendicular oriented sides, and the membrane stack arrangement further comprises sealing compartments which are substantially parallel to the central axis of the housing, each sealing compartment being provided by a corner recess of adjacent membrane cells of the stack of membrane cells in co-operation with a part of the inner surface of the housing; and the stack arrangement further comprises a sealing material to affix the stack of membrane cells to the housing and at least 50% of the sealing material used to affix the stack of membrane cells to the housing is located within the sealing compartments. each membrane cell having a shape with at least four sides (10a, 10b, 10c, 10d), wherein at least one of the sides of the at least four sides (10a, 10b, 10c, 10d) provide a flow input to the membrane cell and at least one of the sides of the at least four sides (10a, 10b, 10c, 10d) provide a flow output from the membrane cell and the other sides of the at least four sides (10a, 10b, 10c, 10d) provide closed side walls of the membrane cell, wherein each membrane cell comprises a corner recess between each two adjacent sides of the at least four sides (10a, 10b, 10c, 10d), wherein the corner recesses are inwardly curved, or wherein each membrane cell has four straight sides and between each two adjacent sides of the four straight sides is a corner recess having two perpendicular oriented sides, and the membrane stack arrangement further comprises sealing compartments which are substantially parallel to the central axis of the housing, each sealing compartment being provided by a corner recess of adjacent membrane cells of the stack of membrane cells in co-operation with a part of the inner surface of the housing; and the stack arrangement further comprises a sealing material to affix the stack of membrane cells to the housing and at least 50% of the sealing material used to affix the stack of membrane cells to the housing is located within the sealing compartments.