bugs fixes from d3plus fixes #40, fixes #41