PHP Notices fixed

PHP Notice in apache error logs and missing variables fixed.
Standardized patterns for ease of removal of deprecated pass by reference later.
Install time notices fixed.