Various cleanup

Fixes for #105, d3 upgrade for #103, and a fix for one point of #108.