Fix for CRM-15594

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