Trying to track down the invariant failure