Several changes that made TvC work more.

See commit 8ddc427d69d384477e85d2510d201655c3d0d0c4 (Lines 338-341)