Add missing lock.
Fix delegation bug.