added string matching for more detailed invariant tests