fixes for CRM-12848

----------------------------------------
* CRM-12848:
  http://issues.civicrm.org/jira/browse/CRM-12848
Merge pull request #1224 from kurund/CRM-12848

fixes for CRM-12848