Thread bug fix.