Filter duplicate statements.

There's an import duplication bug where 

    A
       \_ B -- D
       \_ C -- D

the stuff for D is outputted twice.

So here's a quick fix to filter just before printing.