Resolve PHP notice issues in various php files

Resolves issue #1