Right, I had considered your first case already and it is safe. Passing the mapping by reference would however be good anyway since that would avoid repeating the test for complex content but I never completed that solution since ONERROR setup/cleanup got messy.