Fix "Too many opened parentheses" in _getTransitiveClosure