CRM-13227, CRM-14744: full fix