Fixed thread termination bug.