Migration of stelzi's commit 1022 with some changes so we have a nicer code. See...