Update thread manager and tests