Fixes to eliminate PHP Notices in error log
Various fixes and updates