Fixed fatal crash/deadlock.