CRM-14449 add test to check custom data (& some fixes to pass)