Applying patch from https://www.drupal.org/node/2021833