Fixed a deadlock condition.