Fixed php notices for undefined variables