Table locking fixes