Multithreading fixes for TROOT from Philippe.