Add locking types and debugging output"