Fixed race condition problem from Threads2.