fix notices for PHP 5.4
Merge pull request #74 from dlobo/MiscFixes

fix notices for PHP 5.4