Many small concurrency fixes.