fixing several bugs in the d3 scene tree implementation