Fixing a potential deadlock.