check if 'VIA_ENVIORNMENT' is defined before using
cleanup undefined index/variable warnings
Merge pull request #45 from JeremyDunn/fix-notices

Fix warnings/notices