A bit more intelligent target selecting + debug d3 value.