CRM-15380 - Replaces PR 4273.

----------------------------------------
* CRM-15380:
  https://issues.civicrm.org/jira/browse/CRM-15380