fix spanning tree issue; fix a php notice