Thread creation bug fix.