Bugfix: Invariant computation broken in all cases except my one testcase