fix CRM-12027
Merge pull request #2 from dlobo/CRM-12027

fix CRM-12027
fix notices for PHP 5.4
Merge pull request #3 from dlobo/MiscFixes

fix notices for PHP 5.4