Fixed invariant query, added graph diameter so we can check two invariants at once now