Changed lock.unlock behavior.