Fixes to locking api