Fix bug in isTransitive