Fixed a deadlock.