Fix stability in composer
Backport changes from master