Concurrency bug fixes