Fixes PHP Warning notices Issue #6

Fixes PHP warning notices reported in issue #6