Fixed locking bug.