This commit fixed the PHP notices due to undefined variables