fix some more causes of PHP notices or warnings