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

fix notices for PHP 5.4