CRM-12202

more cleanup and fixes based on comments on https://github.com/civicrm/civicrm-core/pull/264