Thread exception fix.