Added support for deep locking.