Fix for CRM-10331

https://issues.civicrm.org/jira/browse/CRM-10331