Backported a few composer compatibilities from the v2 branch