Fixed the javascript error when a tree node is expanded.