Many bugs fixed through use of d3 selector.filter()