Fix deadlock detection (it now works)