Fix problem with connecting lines on interactive tree.  Tidy code a little