Fixes #45

It was my code, not D3 causing the problem. But the main cause was of course Firefox implementing things differently. It should be fixed now (at least in Chrome, Firefox and Internet Explorer).