fix a clang compiler warning
remove another clang warning
this also fixes a bug with topological torsions and client-provided invariants