Patch to solve CRM-13009 and CRM-13785