Fix contracts and expected computation for tc-any-results.
Avoid using unsafe structure access.

Moral: a little temporary speed should never be bought at the cost of safety.