Update from patch at https://drupal.org/comment/8561399#comment-8561399