fixes for CRM-12848

----------------------------------------
* CRM-12848:
  http://issues.civicrm.org/jira/browse/CRM-12848