Fixed missing thread join.