fix some causes of PHP notices about undefined indices or vars
fix some more causes of PHP notices or warnings
Merge pull request #85 from Thoronador/fix-warnings

Fix warnings