Fix exception control and tread restart