Improved locking.