A bunch of concurrency improvements and corrections