machine: minor cleanup in toc.cc
thread: added corrections for ex 4