CRM-14466 - Made sure variables and array keys were defined to avoid error notices