Thread handling much improved.