Two 3D scenes using D3js and ThreeJS which generate a Mozilla TypeError in certain circumstances