-- CRM-12719 applied patch and improved it.