Fixed pthread routine.