Fix cycle to list the directed edges