Cleanup code.
Fix optimistic concurrency checks on delete.