After-treatment of organic or inorganic membranes