Should fix issue#105.

In some case, the dag had a cycle.

Signed-off-by: Jerome Maloberti <jmaloberti@gmail.com>