Updated for better support for deadlock detector.