Backport the composer code and make groups test pass