Potential fix for PHP Warning

This should fix #327
Merge pull request #334 from TheSerapher/issue-327

Potential fix for PHP Warning