Fix concurrency bug.