Issue #3422

Fix for issue https://github.com/composer/composer/issues/3422
@stof, please take a look.