fix some causes of PHP notices about undefined indices or vars