CRM-12425, merged #792
Merge pull request #853 from kurund/CRM-12425-fixes

CRM-12425, merged #792