fixes as per https://drupal.org/node/2044219
more review fixes https://drupal.org/node/2044219