Fix bug in relevant_cycles()