Fixed some deadlocks caused by CTL-543