Backport changes from drush deploy version.