CRM-12681, fixes for j2
Merge pull request #920 from kurund/CRM-12681

CRM-12681, fixes for j2