Fork of https://drupal.org/sandbox/daspeter/2187519