Fix issues in d3 definition

Fixes issue #482