locking fixes.