Fix #2023

This fix is needed for https://drupal.org/node/2270509
See also #2708