Several changes that made TvC work more.

See commit 888caae6102e13eb3f78d9881264c12055547fb2